This patch enables users to create their own script for analyzing mails.
The 'custom_check' needs to be enabled via pmg.conf (optionally the check's
executable path ('custom_check_path') can be set, defaulting to
'/usr/local/bin/pmg-custom-check').
'pmg-smtp-filter' calls the check before analyze_virus (which in turn calls
clamav or avast). The custom_check 'api' is kept simple:
* Input: the check gets 2 arguments:
* the 'api-version' (currently 'v1') - for potential future change of the
invocation
* the 'queue-file-name' - a filename, which contains the complete e-mail as
rfc822/eml file
* Output: the check needs to return 2 lines on STDOUT:
* the 'api-version' (currently 'v1') - see above
* one of the following 3 results:
* 'OK' - mail is ok
* 'VIRUS: <virusdescription>' - mail is treated as if it contained a virus
(the virusdescription is logged and added to the mail's headers)
* 'SCORE: <number>' - <number> is added (negative numbers are also possible)
to the mail's spamscore
* The check will be killed after a 5 minute timeout - and the mail is
treated as OK
* All output written to STDERR by the check is written to the journal/mail.log
(with priority 'err')