mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 07:06:18 +02:00
Experimental: block list support
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user