Open glassfishrobot opened 11 years ago
@glassfishrobot Commented @bshannon said: A similar request was filed in the old Sun bug system, and included this suggestion:
When sending rcpt commands use the dsn notification properties specified for the receipient currently processing. To implement this in backward compatible way something like this:
props.put("mail.smtp.dsn.notify", "[SUCCESS=mike@mymail.com,James@mymail.com]; [FAILURE=mike@mymail.com,James@mymail.com]");
when the value starts with a '[' than get the DSN properties per receipient else use fallback to the old way. In this way no code that uses the mail api should break.
@glassfishrobot Commented @bshannon said: A clean way to do this might be to add a DSNInternetAddress class that allows DSN information to be specified for each address, but that would require MimeMessage to keep track of the original Address objects instead of immediately serializing them to the headers. A simple solution as proposed above might be easier in the short term.
@glassfishrobot Commented Reported by Revivius
@glassfishrobot Commented This issue was imported from Bugzilla JAVAMAIL-5821
Java Mail API doesn't provide a way to request "different DSN(Delivery Status Notification)s per-recipient" as explained by RFC1891. There is SMTPMessage.setNotifyOptions(int options) but it applies to all recipients in the message.
Suggested workaround is sending multiple 'copies' of the message with a single recipient and desired DSN for that recipient. This is inconvenient because:
Requested enhancement is to allow specifying DSN for each recipient.
Please see: https://forums.oracle.com/forums/thread.jspa?threadID=2493438&tstart=0
Affected Versions
1.4.5
Environment
All All