mirror of https://github.com/M66B/FairEmail.git
Skip classifying filtered messages
This commit is contained in:
parent
efbf1df595
commit
8d4cfb2052
|
@ -3786,12 +3786,16 @@ class Core {
|
|||
|
||||
DB db = DB.getInstance(context);
|
||||
try {
|
||||
boolean executed = false;
|
||||
for (EntityRule rule : rules)
|
||||
if (rule.matches(context, message, imessage)) {
|
||||
rule.execute(context, message);
|
||||
executed = true;
|
||||
if (rule.stop)
|
||||
break;
|
||||
}
|
||||
if (executed)
|
||||
EntityOperation.queue(context, message, EntityOperation.KEYWORD, MessageHelper.FLAG_FILTERED, true);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
db.message().setMessageError(message.id, Log.formatThrowable(ex));
|
||||
|
|
|
@ -104,6 +104,7 @@ public class MessageClassifier {
|
|||
!classified.equals(folder.name) &&
|
||||
!TextUtils.isEmpty(message.msgid) &&
|
||||
!message.hasKeyword(MessageHelper.FLAG_CLASSIFIED) &&
|
||||
!message.hasKeyword(MessageHelper.FLAG_FILTERED) &&
|
||||
!accountMsgIds.get(folder.account).contains(message.msgid) &&
|
||||
!EntityFolder.JUNK.equals(folder.type)) {
|
||||
boolean pro = ActivityBilling.isPro(context);
|
||||
|
|
|
@ -138,6 +138,7 @@ public class MessageHelper {
|
|||
static final String FLAG_FORWARDED = "$Forwarded";
|
||||
static final String FLAG_NOT_JUNK = "$NotJunk";
|
||||
static final String FLAG_CLASSIFIED = "$Classified";
|
||||
static final String FLAG_FILTERED = "$Filtered";
|
||||
|
||||
// https://www.iana.org/assignments/imap-jmap-keywords/imap-jmap-keywords.xhtml
|
||||
// Not black listed: Gmail $Phishing
|
||||
|
@ -145,6 +146,7 @@ public class MessageHelper {
|
|||
MessageHelper.FLAG_FORWARDED,
|
||||
MessageHelper.FLAG_NOT_JUNK,
|
||||
MessageHelper.FLAG_CLASSIFIED, // FairEmail
|
||||
MessageHelper.FLAG_FILTERED, // FairEmail
|
||||
"$MDNSent", // https://tools.ietf.org/html/rfc3503
|
||||
"$SubmitPending",
|
||||
"$Submitted",
|
||||
|
|
Loading…
Reference in New Issue