Added no/multi from header condition

pull/194/merge
M66B 3 years ago
parent 29afe62fca
commit f714cdc218

@ -2407,7 +2407,7 @@ $$flagged$
$$deleted$ $$deleted$
``` ```
To match *passed* message checks via a header condition (since version 1.1787): To match *passed* message checks via a header condition (since version 1.1787; no/multi-from since version 1.1791):
``` ```
$$dkim$ $$dkim$
@ -2416,6 +2416,8 @@ $$dmarc$
$$mx$ $$mx$
$$blocklist$ $$blocklist$
$$replydomain$ $$replydomain$
$$nofrom$
$$multifrom$
``` ```
Note that *regex* should be disable and that there should be no white space. Note that *regex* should be disable and that there should be no white space.

@ -283,6 +283,12 @@ public class EntityRule {
} else if ("$replydomain".equals(keyword)) { } else if ("$replydomain".equals(keyword)) {
if (!Boolean.TRUE.equals(message.reply_domain)) if (!Boolean.TRUE.equals(message.reply_domain))
return false; return false;
} else if ("$nofrom".equals(keyword)) {
if (message.from != null && message.from.length > 0)
return false;
} else if ("$multifrom".equals(keyword)) {
if (message.from == null || message.from.length < 2)
return false;
} else { } else {
List<String> keywords = new ArrayList<>(); List<String> keywords = new ArrayList<>();
keywords.addAll(Arrays.asList(message.keywords)); keywords.addAll(Arrays.asList(message.keywords));

Loading…
Cancel
Save