Discussion:
Banned filenames not extensions
(too old to reply)
Tone Kravanja
2016-02-18 04:37:42 UTC
Permalink
Hi!

I was trying to find and create the banned name for the filenames as recently exactly one type of files prevails as virus threat that is not yet detected by antivirus.

So as lately the attachments are named as invoice_scan_[random number].doc I was trying to create file filter that would detect words invoice and scan regardless to suffix.

So in $banned_filename_re I was trying to add it like this:

qr'(invoice|scan)$';

but it was in vain. As you see I have troubles to understand the regular expression here, so some help would be greatly appreciat
Tone Kravanja
2016-02-18 16:40:50 UTC
Permalink
With a help from Oliver who pointed me into right direction, I corrected my filter and improved on it. And I also aded checking for the file extension.

So my filter now looks like this:

qr'(invoice|scan|rechnung|fattura){1,}.*(doc|xls|docx|xlsx){1,}'ix, # Ban anything that sounds like invoice and is opened by Microsoft office.

Hope this helps someone else too.

Best regards,
Tone Kravanja
Georg Lindner
2016-02-18 21:47:34 UTC
Permalink
Post by Tone Kravanja
qr'(invoice|scan|rechnung|fattura){1,}.*(doc|xls|docx|xlsx){1,}'ix, #
Ban anything that sounds like invoice and is opened by Microsoft office.
Hope this helps someone else too.
Thank you for sharing, this will be added to my amavis "cheat sheet".
Could be handy from time to time...


Georg

Loading...