Support for Auto-Submitted header

This commit is contained in:
M66B
2020-10-02 15:54:45 +02:00
parent 06d206d491
commit b6aedc8e76
11 changed files with 2412 additions and 28 deletions

View File

@@ -258,6 +258,9 @@ public class MessageHelper {
if (message.unsubscribe != null)
imessage.addHeader("List-Unsubscribe", "<" + message.unsubscribe + ">");
if (message.auto_submitted != null && message.auto_submitted)
imessage.addHeader("Auto-Submitted", "auto-replied");
MailDateFormat mdf = new MailDateFormat();
mdf.setTimeZone(hide_timezone ? TimeZone.getTimeZone("UTC") : TimeZone.getDefault());
imessage.setHeader("Date", mdf.format(new Date()));
@@ -1049,6 +1052,14 @@ public class MessageHelper {
return priority;
}
Boolean getAutoSubmitted() throws MessagingException {
// https://tools.ietf.org/html/rfc3834
String header = imessage.getHeader("Auto-Submitted", null);
if (header == null)
return null;
return !"no".equalsIgnoreCase(header);
}
boolean getReceiptRequested() throws MessagingException {
ensureMessage(false);