Skip to content

Commit

Permalink
Merge pull request #4682 from twesterhever/temp-no-ua
Browse files Browse the repository at this point in the history
[Minor] Add rule for messages missing both X-Mailer and User-Agent header
  • Loading branch information
vstakhov committed Nov 3, 2023
2 parents 533e56e + 608a080 commit 5eaf34b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rules/regexp/headers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5eaf34b

Please sign in to comment.