Changes between Initial Version and Version 1 of send-quarantine-digests.pl


Ignore:
Timestamp:
Apr 12, 2006, 11:19:06 PM (17 years ago)
Author:
rjl
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • send-quarantine-digests.pl

    v1 v1  
     1= The send-quarantine-digests.pl script =
     2
     3The send-quarantine-digests.pl script allows you to send out an e-mail digest to your users, containing an HTML-formatted list of the contents of their Maia Mailguard quarantines, generated from a template. Users can then release items as necessary and confirm the status of the remaining items, all from within their e-mail clients, without having to login to the Maia web interface.
     4
     5Each user can specify his or her own digest interval (in minutes) from within the Maia Mailguard web interface, and of course enable/disable the feature as desired. The administrator must be sure to run this script from a cron job at whatever minimum interval makes sense for the system's load. In a low-volume environment, it might be practical to run this script from a cron job every minute, offering users an effective granularity of one minute. It may be more practical in most environments to run this script every five minutes or ten minutes, though of course this will limit how frequently the users can receive their digests, obviously. A granularity of five minutes should probably be more than sufficient for most sites, however.
     6
     7A number of settings in the /etc/maia.conf file control how the digests are formatted:
     8
     9`$base_url` lets you specify the base URL to your Maia Mailguard installation, so that URLs in the digest can be made to point properly to your Maia pages.  For instance, if your users would normally visit !http://www.example.com/maia/login.php to access your Maia scripts, you'd set `$base_url` to !http://www.example.com/maia.
     10
     11{{{
     12# Base URL to Maia's PHP scripts
     13$base_url = "http://example.com/";
     14}}}
     15
     16`$template_dir` tells the script where it can find the digest.tpl template it needs in order to construct the HTML e-mail.  If you want to edit the template itself, of course, that's the one to mess with.
     17
     18{{{
     19# Template directory
     20$template_dir = "/var/amavisd/maia/templates/";
     21}}}
     22
     23`%sort` lets you control how the mail items in the various lists are sorted.  There are five different lists:
     24
     25||`ham`||Non-spam e-mails||
     26||`spam`||Spam e-mails||
     27||`virus`||Virus/Malware-infected e-mails||
     28||`banned_file`||E-mail containing banned file attachments||
     29||`bad_header`||E-mail with invalid mail headers||
     30
     31There are three different sorting criteria you can choose from for each of those mail types:
     32
     33||`score`||Sort by the e-mail's score||
     34||`received_date`||Sort by the date and time the mail was received||
     35||`recipient_id`||Sort by the e-mail's recipient ID||
     36
     37For every sorting criterion, you can choose one of two directions to sort:
     38
     39||`ASC`||Ascending order, lowest to highest, oldest to newest||
     40||`DESC`||Descending order, highest to lowest, newest to oldest||
     41
     42Typically you'll want to sort non-spam ("ham") in descending order by score, so that the items most likely to be false negatives will appear near the top of the list.  Similarly, spotting false positives among the spam is easiest when spam is sorted in ascending order by score.
     43
     44{{{
     45# How you want the sorted (choose one per cache type)
     46# (note: non spam/ham caches don't have score to sort by)
     47# options are:
     48# %sort = "score DIRECTION"
     49#       = "received_date DIRECTION"
     50#       = "recipient_id DIRECTION"
     51# Where DIRECTION is ASC or DESC
     52
     53%sort = (
     54            'ham'   => "score DESC",  # puts the high scores at the top
     55            'spam'  => "score ASC",   # puts the low scroes at the top
     56            'virus' => "received_date DESC",
     57            'banned_file' => "received_date DESC",
     58            'bad_header'  => "received_date DESC",
     59);
     60}}}
     61
     62`$titles` lets you set the text that appears at the beginning of each section of the digest, for each of the five mail types.
     63
     64{{{
     65# Heading titles for each section of the digest report
     66
     67$titles = { 'spam'        =>  "Spam Quarantine",
     68            'virus'       =>  "Virus Quarantine",
     69            'banned_file' =>  "Banned File Attachments",
     70            'bad_header'  =>  "Invalid Email Headers",
     71            'ham'         =>  "Delivered Email"
     72};
     73}}}
     74
     75`@report_order` lets you determine the order the five sections appear in the digest, from top to bottom.  If you don't want a given section to appear at all (e.g. `bad_header`), you can omit it from the list entirely.
     76
     77{{{
     78# The order of the sections of the digest report
     79# Valid elements are 'spam', 'ham', 'virus', banned_file', and 'bad_header'
     80# Omit any of these elements to leave them out of the report
     81
     82@report_order = ('spam','ham','virus','banned_file','bad_header');
     83}}}
     84
     85
     86