mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 06:01:12 +00:00
Improved MDN
This commit is contained in:
parent
c51d2819d5
commit
8c2d9d281b
1 changed files with 11 additions and 1 deletions
|
@ -282,8 +282,18 @@ public class MessageHelper {
|
|||
plainPart.setContent(plainContent, "text/plain; charset=" + Charset.defaultCharset().name());
|
||||
report.addBodyPart(plainPart);
|
||||
|
||||
String from = null;
|
||||
if (message.from != null && message.from.length > 0)
|
||||
from = ((InternetAddress) message.from[0]).getAddress();
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("Reporting-UA: ").append(BuildConfig.APPLICATION_ID).append("; ").append(BuildConfig.VERSION_NAME).append("\r\n");
|
||||
if (from != null)
|
||||
sb.append("Original-Recipient: rfc822;").append(from).append("\r\n");
|
||||
sb.append("Disposition: manual-action/MDN-sent-manually; displayed").append("\r\n");
|
||||
|
||||
BodyPart dnsPart = new MimeBodyPart();
|
||||
dnsPart.setContent("", "message/disposition-notification; name=\"MDNPart2.txt\"");
|
||||
dnsPart.setContent(sb.toString(), "message/disposition-notification; name=\"MDNPart2.txt\"");
|
||||
dnsPart.setDisposition(Part.INLINE);
|
||||
report.addBodyPart(dnsPart);
|
||||
|
||||
|
|
Loading…
Reference in a new issue