Skip to content
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

Use SMTP Message instead of MimeMessage to get access to setEnvelopeForm [SPR-16443] #20988

Open
spring-projects-issues opened this issue Jan 31, 2018 · 0 comments
Labels
in: messaging type: enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jan 31, 2018

Janning Vygen opened SPR-16443 and commented

When you use a MimeMessageHelper you can't set the "envelope from" only by setting a property "mail.smtp.from" for the java mail session. But this property affects every mail. It makes sense to set an variable envelope return path (VERP) for every message to process bounces.

com.sun.mail.smtp.SMTPMessage extends MimeMessage and is supporting setEnvelopeFrom which overrides "mail.smtp.from".

At the moment you can achieve this only by building a new MimeMessage

MimeMessageHelper helper;
SMTPMessage smtpMessage = new SMTPMessage(helper.getMimeMessage());
smtpMessage.setEnvelopeFrom(verpAddress)
javaMailSender.send(smtpMessage)

It would be quite easy to use SMTPMessage instead of MimeMessage


Affects: 5.0.3

Reference URL: http://cephas.net/blog/2006/06/09/using-apache-james-and-javamail-to-implement-variable-envelope-return-paths/

@spring-projects-issues spring-projects-issues added in: messaging type: enhancement labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: messaging type: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant