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
{{ message }}
Repository navigation
MailerGenericBuilder.async() is ignored by testConnection() #615
MailerGenericBuilder.async() is intended as a preconfigured default so callers do not need to pass async flags manually. That default applies to both sending mail and testing the SMTP connection.
Currently sendMail(email) honors the builder-level async default through operationalConfig.isAsync(), but testConnection() delegates directly to testConnection(false) and therefore always runs synchronously.
There is a second asymmetry in the explicit async path: sendMail(..., true) falls back to Simple Java Mail's built-in async handler when batch-module is not present, while testConnection(true) directly loads batch-module and fails when that optional module is absent.
Expected behavior
When a mailer is built with .async(), calling:
mailer.testConnection();
should behave like:
mailer.testConnection(true);
and return immediately while the connection test runs through the configured async execution path.
When batch-module is available, async connection testing can use it. When batch-module is absent, async connection testing should still work through the built-in async handler, matching the behavior of async sendMail(...).
Current behavior
mailer.testConnection() blocks because it hardcodes false, regardless of the builder-level async configuration.
mailer.testConnection(true) requires batch-module, even though async sending already has a built-in fallback.
Notes
This came up while triaging #608. The no-arg method blocking is valid for a normal synchronous mailer, but not for a mailer explicitly configured with .async().
MailerGenericBuilder.async() now applies to no-arg mailer.testConnection() through the configured async default.
testConnection(true) now mirrors async sendMail(...): it uses batch-module when available and falls back to the built-in async handler when that optional module is absent.
Activity
bbottema commentedon Jul 3, 2026
Implemented.
Summary:
MailerGenericBuilder.async()now applies to no-argmailer.testConnection()through the configured async default.testConnection(true)now mirrors asyncsendMail(...): it usesbatch-modulewhen available and falls back to the built-in async handler when that optional module is absent.Usage:
fix(mailer): honor async test connection default
bbottema commentedon Jul 8, 2026
Released in Simple Java Mail v9.0.0, which is now available from Maven Central:
https://repo1.maven.org/maven2/org/simplejavamail/simple-java-mail/9.0.0/
Release notes:
https://github.com/bbottema/simple-java-mail/releases/tag/9.0.0