You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem?
Currently, to use smtp-connection-pool, developers must adopt the custom SmtpConnectionPool API directly. This prevents developers from using the pool in legacy codebases, Spring JavaMailSender, Apache Camel, or frameworks that rely strictly on standard jakarta.mail.Session and jakarta.mail.Transport.
Describe the solution you'd like
Add a lightweight Jakarta Mail SPI Provider module (e.g., smtp-connection-pool-spi or registering a custom protocol like smtppool in META-INF/javamail.providers).
This module would provide a PooledTransport implementation that extends jakarta.mail.Transport:
connect() -> Claims an open connection from SmtpConnectionPool
sendMessage() -> Delegates to the leased Transport
close() -> Releases the connection back to SmtpConnectionPool
Why this adds value
Zero API Lock-in: Users can configure pooling entirely via standard Session properties (e.g., mail.smtppool.host, mail.smtppool.size).
Drop-in Compatibility: Allows existing applications and third-party frameworks to benefit from smtp-connection-pool without touching business code or replacing Transport.send() / JavaMailSender.
Massive Adoption: Removes the barrier to entry for enterprise applications tied to standard Jakarta Mail APIs.
Keep the existing direct smtp-connection-pool API. Higher-level Simple Java Mail remains a deliberate direct integration and will not route its own Mailer through PooledTransport.
Add a shared, explicit transport-lease contract in the core so direct integrations and the provider use the same release/invalidate semantics.
Add an opt-in Jakarta Mail provider artifact registering smtppool. connect claims a lease, sendMessage delegates, and close releases or invalidates based on the outcome.
Resolve the real delegate explicitly as smtp or smtps; never call the Session's default transport from the pooled provider, which could recursively select itself.
Add an opt-in Camel adapter that selects smtppool without globally replacing Camel/Jakarta Mail's normal smtp provider.
Preserve the existing core GAV and ship the three consumer-facing artifacts as one version-aligned reactor.
Treat this as an additive minor release, currently planned as 3.2.0, subject to implementation and separate release approval.
The organization-level usage model has three paths: direct core integration (including Simple Java Mail internally), standalone use of Simple Java Mail's batch module after it gains a public callback API, and the standard Jakarta Mail facade for plain Jakarta Mail/Spring/Camel.
The downstream Simple Java Mail and simplejavamail.org work is tracked in bbottema/simple-java-mail#698 and starts only after the upstream release is published.
Per the maintainer release workflow, the 3.2.0 milestone will be created and dated when a real publication date is scheduled; no tag or release is authorized by this planning comment.
Thanks for laying out such a thorough and clear architectural plan for 3.2.0! The 3-tiered model and the recursive selection safeguards make total sense.
I would be happy to contribute the implementation for the smtp-connection-pool-provider module (the smtppool Jakarta Mail SPI adapter) following your specifications:
Registering smtppool in META-INF/javamail.providers.
Explicitly delegating to smtp/smtps (avoiding recursive Session default lookups).
Integrating with the shared transport-lease contract (connect() claims, sendMessage() executes, close() releases or invalidates based on execution state).
The smtppool provider supports plain Jakarta Mail and Spring; Camel uses the separate smtppool: / smtppools: adapter. The existing direct coordinate and Java 8 baseline remain intact. Configuration and runnable examples are linked from the README.
It was surprisingly fast, awesome. Were you just waiting behind the bush with already implemented feature in your pocket when will someone come and ask for it? :D
Than you the fast delivery, I will come back with the experiences of our team.
changed the title [-]Feature Request: Native Jakarta Mail Provider SPI (Drop-in Transport Pool)[/-][+]Provide a native Jakarta Mail Provider SPI[/+]on Aug 12, 2026
Activity
bbottema commentedon Aug 9, 2026
Maintainer planning outcome for this request:
smtp-connection-poolAPI. Higher-level Simple Java Mail remains a deliberate direct integration and will not route its own Mailer throughPooledTransport.smtppool.connectclaims a lease,sendMessagedelegates, andclosereleases or invalidates based on the outcome.smtporsmtps; never call the Session's default transport from the pooled provider, which could recursively select itself.smtppoolwithout globally replacing Camel/Jakarta Mail's normalsmtpprovider.3.2.0, subject to implementation and separate release approval.The organization-level usage model has three paths: direct core integration (including Simple Java Mail internally), standalone use of Simple Java Mail's batch module after it gains a public callback API, and the standard Jakarta Mail facade for plain Jakarta Mail/Spring/Camel.
The downstream Simple Java Mail and simplejavamail.org work is tracked in bbottema/simple-java-mail#698 and starts only after the upstream release is published.
Per the maintainer release workflow, the
3.2.0milestone will be created and dated when a real publication date is scheduled; no tag or release is authorized by this planning comment.verhasi commentedon Aug 10, 2026
Hi Benny,
Thanks for laying out such a thorough and clear architectural plan for 3.2.0! The 3-tiered model and the recursive selection safeguards make total sense.
I would be happy to contribute the implementation for the
smtp-connection-pool-providermodule (thesmtppoolJakarta Mail SPI adapter) following your specifications:smtppoolinMETA-INF/javamail.providers.smtp/smtps(avoiding recursive Session default lookups).connect()claims,sendMessage()executes,close()releases or invalidates based on execution state).Please let me know if you'd like me to draft a Pull Request for this module, and if it fits your needs to follow the directions for development at https://github.com/bbottema/simple-java-mail/blob/master/DEVELOPMENT.md!
Best regards,
István
bbottema commentedon Aug 10, 2026
Thank you for the offer @verhasi, but it's already implemented :)
Released in v4.0.0.
The release publishes:
org.simplejavamail:smtp-connection-pool:4.0.0org.simplejavamail:smtp-connection-pool-jakarta-provider:4.0.0org.simplejavamail:smtp-connection-pool-camel:4.0.0The
smtppoolprovider supports plain Jakarta Mail and Spring; Camel uses the separatesmtppool:/smtppools:adapter. The existing direct coordinate and Java 8 baseline remain intact. Configuration and runnable examples are linked from the README.verhasi commentedon Aug 11, 2026
Hi Benny,
It was surprisingly fast, awesome. Were you just waiting behind the bush with already implemented feature in your pocket when will someone come and ask for it? :D
Than you the fast delivery, I will come back with the experiences of our team.
bbottema commentedon Aug 11, 2026
@verhasi, a field-test would be very helpful!
bbottema commentedon Aug 11, 2026
Also, this guide may be helpful: https://www.simplejavamail.org/smtp-connection-pooling.html
[-]Feature Request: Native Jakarta Mail Provider SPI (Drop-in Transport Pool)[/-][+]Provide a native Jakarta Mail Provider SPI[/+]