Repository navigation
Closed
Description
Summary
Simple Java Mail rejects every builder-managed SOCKS proxy combined with TransportStrategy.SMTPS:
if (transportStrategy == TransportStrategy.SMTPS) {
throw new MailerException(MailerException.INVALID_PROXY_SLL_COMBINATION);
}The exception says this is a limitation of the underlying mail framework. That no longer matches Angus Mail's documented properties or socket implementation.
Technical evidence
- Angus documents that SMTPS uses the same SMTP provider properties under the
mail.smtps.*prefix, includingmail.smtps.socks.hostandmail.smtps.socks.port:
https://eclipse-ee4j.github.io/angus-mail/docs/api/org.eclipse.angus.mail/org/eclipse/angus/mail/smtp/package-summary.html - Angus
SocketFetchercreates a SOCKS-backed plain socket, connects it to the target through the proxy, and then wraps that connected socket in anSSLSocketwhen implicit TLS is requested:
https://github.com/eclipse-ee4j/angus-mail/blob/master/core/src/main/java/org/eclipse/angus/mail/util/SocketFetcher.java - Simple Java Mail's
TransportStrategy.SMTPSalready resolves the appropriatemail.smtps.socks.*property names. The explicit guard is the only thing preventing their use.
Lineage
The restriction first appears in commit 322ff855 from June 2016 and first shipped in 4.1.1. It converted an earlier warning that JavaMail ignored proxy settings for SSL connections into a hard failure. The supporting assumption has remained in ProxyConfig Javadoc ever since.
Documentation defect
The Spring production-profile example combines SMTPS with proxy credentials but omits the proxy host and port. Because ProxyConfig.requiresProxy() depends on a host, that example never activates proxying.
Expected behavior
- Anonymous SOCKS proxying works with
TransportStrategy.SMTPS. - Authenticated SOCKS proxying routes the SMTPS connection through Simple Java Mail's local authentication bridge.
- SMTPS certificate and hostname verification behavior remains unchanged.
- The obsolete exception and Javadoc restriction are removed.
- Website examples contain a complete, valid proxy configuration.
Acceptance criteria
- A local integration test proves an SMTPS connection reaches the TLS-enabled SMTP endpoint through SOCKS.
- Authenticated proxy routing is covered if practical with the existing bridge test infrastructure.
- Existing SMTP and STARTTLS proxy behavior remains unchanged.
- The Spring profile and proxy documentation are corrected.
Activity
bbottema commentedon Aug 6, 2026
Implemented in 908d887. The obsolete SMTPS/proxy guard has been removed and the API guidance corrected. The corresponding website configuration and capability guidance is updated in simple-java-mail/simplejavamail.org@56810b3. This restores SOCKS routing for SMTPS while leaving SMTP and STARTTLS behavior unchanged.
fix(proxy): support SMTPS routing through SOCKS (#687)
bbottema commentedon Aug 8, 2026
Available in Simple Java Mail 9.1.8. SOCKS routing now supports
SMTPSwhile retaining the normal implicit-TLS certificate and hostname checks.fix(proxy): support SMTPS routing through SOCKS (#687)