|
|
@ -145,6 +145,13 @@ public class MessageHelper {
|
|
|
|
StandardCharsets.UTF_16LE
|
|
|
|
StandardCharsets.UTF_16LE
|
|
|
|
));
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final List<String> DO_NOT_REPLY = Collections.unmodifiableList(Arrays.asList(
|
|
|
|
|
|
|
|
"noreply",
|
|
|
|
|
|
|
|
"no.reply",
|
|
|
|
|
|
|
|
"no-reply",
|
|
|
|
|
|
|
|
"do-not-reply"
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
|
|
static final String FLAG_FORWARDED = "$Forwarded";
|
|
|
|
static final String FLAG_FORWARDED = "$Forwarded";
|
|
|
|
static final String FLAG_JUNK = "$Junk";
|
|
|
|
static final String FLAG_JUNK = "$Junk";
|
|
|
|
static final String FLAG_NOT_JUNK = "$NotJunk";
|
|
|
|
static final String FLAG_NOT_JUNK = "$NotJunk";
|
|
|
@ -3216,6 +3223,29 @@ public class MessageHelper {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static boolean isNoReply(Address address) {
|
|
|
|
|
|
|
|
if (address instanceof InternetAddress) {
|
|
|
|
|
|
|
|
String email = ((InternetAddress) address).getAddress();
|
|
|
|
|
|
|
|
String username = UriHelper.getEmailUser(email);
|
|
|
|
|
|
|
|
String domain = UriHelper.getEmailDomain(email);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!TextUtils.isEmpty(username)) {
|
|
|
|
|
|
|
|
username = username.toLowerCase(Locale.ROOT);
|
|
|
|
|
|
|
|
for (String value : DO_NOT_REPLY)
|
|
|
|
|
|
|
|
if (username.contains(value))
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!TextUtils.isEmpty(domain)) {
|
|
|
|
|
|
|
|
domain = domain.toLowerCase(Locale.ROOT);
|
|
|
|
|
|
|
|
for (String value : DO_NOT_REPLY)
|
|
|
|
|
|
|
|
if (domain.startsWith(value))
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static boolean equalEmail(Address a1, Address a2) {
|
|
|
|
static boolean equalEmail(Address a1, Address a2) {
|
|
|
|
String email1 = ((InternetAddress) a1).getAddress();
|
|
|
|
String email1 = ((InternetAddress) a1).getAddress();
|
|
|
|
String email2 = ((InternetAddress) a2).getAddress();
|
|
|
|
String email2 = ((InternetAddress) a2).getAddress();
|
|
|
|