Decode Sensitivity header

This commit is contained in:
M66B
2022-01-18 10:07:13 +01:00
parent 4977d372e8
commit e71f92c938
6 changed files with 2740 additions and 1 deletions

View File

@@ -1583,6 +1583,27 @@ public class MessageHelper {
return priority;
}
Integer getSensitivity() throws MessagingException {
ensureHeaders();
// https://www.rfc-editor.org/rfc/rfc4021.html#section-2.1.55
String header = imessage.getHeader("Sensitivity", null);
if (TextUtils.isEmpty(header))
return null;
header = header.toLowerCase(Locale.ROOT);
if (header.contains("personal"))
return EntityMessage.SENSITIVITY_PERSONAL;
if (header.contains("private"))
return EntityMessage.SENSITIVITY_PRIVATE;
if (header.contains("company")) // company-confidential
return EntityMessage.SENSITIVITY_CONFIDENTIAL;
return null;
}
Boolean getAutoSubmitted() throws MessagingException {
// https://tools.ietf.org/html/rfc3834
String header = imessage.getHeader("Auto-Submitted", null);