Get spamassassin to drop emails containing a specific REGEX in attached filenames

Viewed 6232

newbie asking first question :)

I'm running a mail server (Ubuntu/Postfix/Dovecot) with SpamAssassin. Most of the known spam is flagged (RBLs, and obvious UCE) except for this particular malspam in attached zip files like "order_info_654321.zip", "paymet_document_123456.zip", and so on, when it doesn't fit any other SA rules. I'd like to procure a rule which drops the matching offenders into oblivion.

After fiddling with regex101.com, I've come up with an expression that matches these patterns exclusively:

/\w+[_][0-9]{6}.zip$/img

Question is... How to format it all, get it to work, and where to put it? So far, I edited /etc/spamassassin/local.cf, added this to the bottom, and restarted:

mimeheader TROJAN_ATTACHED Content-Type =~ /\w+[_][0-9]{6}.zip$/img
describe ZIP_ATTACHED email contains a zip trojan attachment
score TROJAN_ATTACHED 99.

But it doesn't seem to do the magic. Where else can I look for this?

Thank you all, Keijo.-

3 Answers
Related