From 4737da53d88a31d9e90e9803a4f707e1dcbe58da Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 31 Jan 2022 09:12:54 +0100 Subject: [PATCH] Added $$tls$ rule condition --- FAQ.md | 7 ++++--- app/src/main/java/eu/faircode/email/EntityRule.java | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/FAQ.md b/FAQ.md index 664e08be6e..a74e59df62 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2430,17 +2430,18 @@ $$flagged$ $$deleted$ ``` -To match *passed* message checks via a header condition (since version 1.1787; no/multi-from since version 1.1791): +To match *passed* message checks via a header condition (since version 1.1787): ``` +$$tls$ (since version 1.1826) $$dkim$ $$spf$ $$dmarc$ $$mx$ $$blocklist$ $$replydomain$ -$$nofrom$ -$$multifrom$ +$$nofrom$ (since version 1.1791) +$$multifrom$ (since version 1.1791) ``` Note that *regex* should be disable and that there should be no white space. diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 47e94d6513..aaa0739568 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -271,7 +271,10 @@ public class EntityRule { value.endsWith("$")) { String keyword = value.substring(1, value.length() - 1); - if ("$dkim".equals(keyword)) { + if ("$tls".equals(keyword)) { + if (!Boolean.TRUE.equals(message.tls)) + return false; + } else if ("$dkim".equals(keyword)) { if (!Boolean.TRUE.equals(message.dkim)) return false; } else if ("$spf".equals(keyword)) {