mail-api
mail-api copied to clipboard
Allow Requesting different Delivery Status Notifications per recipient
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:
- Number of recipients and/or message size may be considerably high
- Sending multiple messages will create different instances (with different Message-IDs) that will be harder to track (mainly for administration purposes on server and client)
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
- Issue Imported From: https://github.com/javaee/javamail/issues/58
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @bshannon
@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=[email protected],[email protected]]; [FAILURE=[email protected],[email protected]]");
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