Add procmail to the mix

Shortt, Kevin KShortt at ussco.com
Wed Jan 18 20:47:43 GMT 2006


Rodney, 

This is what I do...  My recipes are listed below the write up.
I hope this helps. Let me know if you need any thing else.

1. Global procmail config backs up every piece of local email that hits my
server into mbox format files on an hourly basis.

2. User procmailrc files filters tagged spam (by MailScanner) and places
them into a /spam/<username>/<username>-CCYY-MM-DD file.  (One file for each
day.)  These files are accessible by each user with their email client by a
sym link from their mail directory.
   i.e.  Username is "joe".   A quick list of their spam folder would look
like this...

-rw-------    1 joe   staff      802964 Jan 13 23:02 joe-2006-01-13
-rw-------    1 joe   staff      664589 Jan 14 23:41 joe-2006-01-14
-rw-------    1 joe   staff      618340 Jan 15 23:45 joe-2006-01-15
-rw-------    1 joe   staff     1141547 Jan 16 22:44 joe-2006-01-16
-rw-------    1 joe   staff      809962 Jan 17 23:50 joe-2006-01-17
-rw-------    1 joe   staff      197969 Jan 18 14:34 joe-2006-01-18


3. I have a three week purge of all files in that structure. This gives each
user three weeks to sift through their spam folders for false positives.  





My recipies:

Global rc file:

# Make sure you rotate this file.
LOGFILE=/var/log/procmail.log.system
LOGABSTRACT=all
HOURLY_DATE=`/bin/date +%Y-%m-%d-%H`
#VERBOSE=off

#####
# DO NOT REMOVE THIS RECIPE!!!
# This backs up every incoming message.
:0 c
/backup/mail/incoming/$HOURLY_DATE
#####    



Typical User .procmailrc:

SHELL=/bin/sh
HOME=/home/joe
MAILDIR=$HOME/Mail      # You'd better make sure it exists
DEFAULT=/var/spool/mail/joe
# Make sure you are rotating this log.
LOGFILE=$MAILDIR/procmail.log
LOGABSTRACT=all
VERBOSE=on
LOCKFILE=$HOME/.lockmail
SENDMAIL=/usr/sbin/sendmail
# used only if you need to super-cede the spam filter recipe below.
#INCLUDERC=$HOME/.procmail-preprocess
USERNAME=joe
SPAMFOLDER=/spam/joe
DATE=`/usr/bin/date +%Y-%m-%d`
HOURLY_DATE=`/usr/bin/date +%Y-%m-%d-%H`

# These three lines sort the mail into the spam folder.  Remove them to have
it just in the inbox.
:0:
* ^X-MailScanner-SpamCheck: spam,.*
$SPAMFOLDER/$USERNAME-$DATE

# This recipe backs up all email that is not recognized as Spam.
:0 c
$MAILDIR/backup/$HOURLY_DATE



More information about the MailScanner mailing list