|
|
|
@ -3025,23 +3025,28 @@ class Core {
|
|
|
|
|
// No blocklist
|
|
|
|
|
|
|
|
|
|
if (message.from != null) {
|
|
|
|
|
boolean blocked = false;
|
|
|
|
|
EntityContact badboy = null;
|
|
|
|
|
for (Address from : message.from) {
|
|
|
|
|
String email = ((InternetAddress) from).getAddress();
|
|
|
|
|
if (TextUtils.isEmpty(email))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
EntityContact badboy = db.contact().getContact(message.account, EntityContact.TYPE_JUNK, email);
|
|
|
|
|
badboy = db.contact().getContact(message.account, EntityContact.TYPE_JUNK, email);
|
|
|
|
|
if (badboy != null)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (badboy != null) {
|
|
|
|
|
badboy.times_contacted++;
|
|
|
|
|
badboy.last_contacted = new Date().getTime();
|
|
|
|
|
db.contact().updateContact(badboy);
|
|
|
|
|
|
|
|
|
|
EntityLog.log(context, account.name + " POP blocked=" +
|
|
|
|
|
MessageHelper.formatAddresses(message.from));
|
|
|
|
|
blocked = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (blocked)
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean needsHeaders = EntityRule.needsHeaders(message, rules);
|
|
|
|
|
List<Header> headers = (needsHeaders ? helper.getAllHeaders() : null);
|
|
|
|
@ -4572,21 +4577,29 @@ class Core {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (EntityFolder.INBOX.equals(folder.type))
|
|
|
|
|
if (message.from != null)
|
|
|
|
|
if (message.from != null) {
|
|
|
|
|
EntityContact badboy = null;
|
|
|
|
|
for (Address from : message.from) {
|
|
|
|
|
String email = ((InternetAddress) from).getAddress();
|
|
|
|
|
if (TextUtils.isEmpty(email))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
EntityContact badboy = db.contact().getContact(message.account, EntityContact.TYPE_JUNK, email);
|
|
|
|
|
badboy = db.contact().getContact(message.account, EntityContact.TYPE_JUNK, email);
|
|
|
|
|
if (badboy != null)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (badboy != null) {
|
|
|
|
|
badboy.times_contacted++;
|
|
|
|
|
badboy.last_contacted = new Date().getTime();
|
|
|
|
|
db.contact().updateContact(badboy);
|
|
|
|
|
|
|
|
|
|
EntityFolder junk = db.folder().getFolderByType(message.account, EntityFolder.JUNK);
|
|
|
|
|
if (junk != null) {
|
|
|
|
|
EntityOperation.queue(context, message, EntityOperation.MOVE, junk.id);
|
|
|
|
|
message.ui_hide = true;
|
|
|
|
|
executed = true;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|