mirror of https://github.com/M66B/FairEmail.git
Consider DMARC with all NONE policies as neutral
This commit is contained in:
parent
036923b2b9
commit
0197d736ff
|
@ -2167,9 +2167,24 @@ public class MessageHelper {
|
|||
continue;
|
||||
String[] val = v.split("\\s+");
|
||||
if (val.length > 0) {
|
||||
if ("fail".equals(val[0]))
|
||||
if ("fail".equals(val[0])) {
|
||||
if ("dmarc".equals(type)) {
|
||||
// dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=example.com
|
||||
int s = v.indexOf('(');
|
||||
int e = v.indexOf(')');
|
||||
if (s > 0 && e > s) {
|
||||
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]))
|
||||
none = (none == null || none) && "none".equalsIgnoreCase(kv[1]);
|
||||
}
|
||||
if (none != null && none)
|
||||
continue; // neutral
|
||||
}
|
||||
}
|
||||
result = false;
|
||||
else if ("pass".equals(val[0])) {
|
||||
} else if ("pass".equals(val[0])) {
|
||||
// https://www.rfc-editor.org/rfc/rfc7489#section-3.1.1
|
||||
if ("dkim".equals(type))
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue