summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authortwesterhever <40121680+twesterhever@users.noreply.github.com>2023-11-03 14:01:07 +0000
committertwesterhever <40121680+twesterhever@users.noreply.github.com>2023-11-03 14:01:07 +0000
commit608a080d1142fd51c43fda158f8b62092d9cf837 (patch)
tree418d0bf98d06ea3adae3b208a2e75710df791dff /rules
parent533e56e13187e21cbdc87722e0ab221ce28be2dd (diff)
downloadrspamd-608a080d1142fd51c43fda158f8b62092d9cf837.tar.gz
rspamd-608a080d1142fd51c43fda158f8b62092d9cf837.zip
[Minor] Add rule for messages missing both X-Mailer and User-Agent header
Diffstat (limited to 'rules')
-rw-r--r--rules/regexp/headers.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/rules/regexp/headers.lua b/rules/regexp/headers.lua
index c4411e53a..0624997aa 100644
--- a/rules/regexp/headers.lua
+++ b/rules/regexp/headers.lua
@@ -949,6 +949,16 @@ reconf['XM_UA_NO_VERSION'] = {
group = 'experimental'
}
+-- Detects messages missing both X-Mailer and User-Agent header
+local has_ua = 'header_exists(User-Agent)'
+local has_xmailer = 'header_exists(X-Mailer)'
+reconf['MISSING_XM_UA'] = {
+ re = string.format('!%s && !%s', has_xmailer, has_ua),
+ score = 0.0,
+ description = 'Message has neither X-Mailer nor User-Agent header',
+ group = 'headers',
+}
+
-- X-Mailer for old MUA versions which are forged by spammers
local old_x_mailers = {
-- Outlook Express 6.0 was last included in Windows XP (EOL 2014). Windows