I'm using Postfix, amavis-new, and spamassassin, on an Ubunutu 22.04 install with a configuration that mostly works just fine.
I want to boost the spam score for certain X-Mailer headers. But, some rules seem to refuse to hit.
Consider the following rules in /etc/spamassassin/local.cf
header X-MAILER_TEST X-Mailer =~ /Test/i
describe X-MAILER_TEST From Test mailer.
score X-MAILER_TEST 0.999
# Previous rule would not hit. Added test rule for ANY X-Mailer header.
header HAS_X-MAILER exists:X-Mailer
describe HAS_X-MAILER Test if X-Mailer header exists.
score HAS_X-MAILER 0.999
# No hits?!?!
# Test if any header rule works.
header TO_MINIME_AT To =~ /minime\@example\.com/
describe TO_MINIME_AT Messages addressed to minime, rather than Me.
score TO_MINIME_AT 0.999
# This works fine!!!
Neither of the X-Mailer rules will hit on messages that contain X-Mailer: Test in the header.
The To header rule does hit, so some header checking is working but checking for an X-Mailer header refuses to hit and I can't see why.