From d81a61a3f6d6798e4c1219475ea93a31a2b9c372 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 24 Sep 2023 08:56:52 +0200 Subject: [PATCH] Check DMARC sub/domain policy only --- app/src/main/java/eu/faircode/email/MessageHelper.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index f1c7d11c9d..30b682a5d0 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -2176,7 +2176,10 @@ public class MessageHelper { Boolean none = null; for (String p : v.substring(s + 1, e).split("\\s+")) { String[] kv = p.split("="); - if (kv.length == 2 && "none".equalsIgnoreCase(kv[1])) + // Without getting the DMARC DNS record, it isn't possible to check the sub/domain + if (kv.length == 2 && + ("p".equalsIgnoreCase(kv[0]) || "sp".equalsIgnoreCase(kv[0])) && + "none".equalsIgnoreCase(kv[1])) none = (none == null || none) && "none".equalsIgnoreCase(kv[1]); } if (none != null && none)