Arbitrary tweets made by TheGingerDog up to 27 December 2015
Note to self … if you need to pass a “doctored” email into Amavis, that’s running as a daemon on the local computer, without it going IN through Postfix (and getting mangled) ….
While trying to block spam posts on a forum, I noticed this gem.
No doubt someone’s spam sending program has failed, just a little….
Some random bits and pieces related to SpamAssassin and Amavis
rewrite_header Subject *****SPAM*****
directive in spamassassin (/etc/spamassassin/local.cf) seemed to be being ignored – and the only effect of the mail being classified as spam is/was a couple of additional headers added (X-Spam-Status: spam). For the customer in question this wasn’t of much use – as they’re reasonably non-technical and probably couldn’t create a client side mail filter. And they also thought the spamfiltering wasn’t working.
I found adding the following to /etc/exim4/system_filter results in the subject being appropriately modified :
if $h_X-Spam-Status: contains "spam" then headers add "Old-Subject: $h_subject" headers remove "Subject" headers add "Subject: *** SPAM *** $h_old-subject" headers remove "Old-Subject" endif
And if you want to tag virus-ey emails … add this in as well :
# X-Anti-Virus: infected if $h_X-Anti-Virus: contains "infected" then headers add "Old-Subject: $h_subject" headers remove "Subject" headers add "Subject: *** VIRUS *** $h_old-subject" headers remove "Old-Subject" endif
Seeing as how that took about 2 hours to figure out – hopefully this will be of use to others.
I started looking at SpamAssassin and wondering why IT wasn’t doing it… I still don’t know why – but assume it’s an Exim ‘feature’.