PerlScanner module

The perlscanner module in Qmail-Scanner allows you to tell Qmail-Scanner to block Email containing certain characteristics, such as particular Subject lines, or attachments of certain filenames or sizes.

It is pretty generic, which means it can match explicitly and via regex. e.g. you could say "reject all Email containing a Subject line of 'roasted peppers for dinner'", or "reject all Email containing any sized .MP3 attachments".

The format is straight-forward: A "variable", a "type" and a "description". The "variable" is the value of the thing you are wanting to block (typically a string or a file attachment size), the "type" refers to either a mail header or a file attachment filename/extension, and the "description" describes what is being blocked

e.g.

#block PIF files of any size
.pif<TAB>SIZE=-1<TAB>PIF files blocked by Policy

#block emails with a Subject: line matching the regular expression ^You are 0wNed$
You are 0wNed<TAB>Policy-Subject:<TAB>Nasty emails not allowed

Just edit/var/spool/qscan/quarantine-events.txt and follow the examples within.

Afterwards, run "/var/qmail/bin/qmail-scanner-queue.pl -g" to rebuild the database, and "/var/qmail/bin/qmail-scanner-queue.pl -r" to read the current attributes.

NOTE: Remember the entries must be TAB delimited - normal spaces will not do!

Last Updated: