-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: withEmailDefaults
and withEmailOverrides
does not work with CustomMailer
#448
Comments
Most defaults are set when creating the Email, but overrides happen during sending as well as the defaults for smime/dkim. Those will fail currently. However, I'm currently working on an overhaul regarding defaults and overrides. And this will be addressed. |
Thank you for your response. Related issue I am facing is that even with I will be happy if in future, it can be addressed somehow. Thank you very much for this awesome library :) |
withEmailDefaults
and withEmailOverrides
does not work with CustomMailer
withEmailDefaults
and withEmailOverrides
does not work with CustomMailer
Btw, as a workaround you can disable the completeness validation using I gotta ask though, why is From not relevant in your use case? For the purpose of sending emails, in whatever form, according to RFC 5322 the From header is mandatory. |
I have a logging An example in Kotlin: val mailer = when (smtpUrl) {
null -> MailerBuilder
.withCustomMailer(LoggingMailer)
.disablingAllClientValidation(true)
.clearEmailValidator()
.buildMailer()
else -> MailerBuilder
.withSMTPServer(smtpUrl.host, smtpUrl.port, smtpUrl.user, smtpUrl.password)
.withTransportStrategy(TransportStrategy.valueOf(smtpUrl.protocol.name.uppercase()))
.withSessionTimeout(5000)
.withEmailOverrides(
EmailBuilder.startingBlank()
.from(smtpUrl.parameters.getOrFail("from"))
.buildEmail()
)
.buildMailer()
}!! |
I see. In that case, does |
Yes, thank you, it is working perfectly now :) |
The only little improvement for readabolity would be to create an override of But i know it is just cosmetic and readability, so just to note you. Thank you very much for this library :) |
Oh sorry, the solution with It throws: |
Ahh indeed, I just checked the code and the completeness check is always performed. I will disable this along with the other validations in case of |
Thank you very much :) |
I released 8.0.0, which now should always apply defaults and overrides in all scenarios. Please let me know if you run into any issue. Note, I'm still in the process of updating the documentation on simplejavamail.org. |
It is simply ignored.
The text was updated successfully, but these errors were encountered: