Experimental: block list support

This commit is contained in:
M66B
2020-01-30 12:48:50 +01:00
parent 4f663365b7
commit 4504d69aaa
2 changed files with 58 additions and 0 deletions

View File

@@ -96,6 +96,8 @@ public class MessageHelper {
static final int DEFAULT_ATTACHMENT_DOWNLOAD_SIZE = 256 * 1024; // bytes
static final long ATTACHMENT_PROGRESS_UPDATE = 1500L; // milliseconds
// https://tools.ietf.org/html/rfc4021
static void setSystemProperties(Context context) {
System.setProperty("mail.mime.decodetext.strict", "false");
@@ -835,6 +837,18 @@ public class MessageHelper {
return result;
}
String getReceivedFromHost() throws MessagingException {
String[] received = imessage.getHeader("Received");
if (received == null || received.length == 0)
return null;
String[] h = MimeUtility.unfold(received[received.length - 1]).split("\\s+");
if (h.length > 1 && h[0].equalsIgnoreCase("from"))
return h[1];
return null;
}
private Address[] getAddressHeader(String name) throws MessagingException {
String header = imessage.getHeader(name, ",");
if (header == null)