Server Side Filtering with Procmail

 

Benefits of procmail:

Where does it go:

Sample Recipe:

 

--------------cut from here------------------
PATH=/bin:/usr/bin:/usr/bin
LOGFILE=$HOME/procmail.log # Comment out if you do not want logs
VERBOSE=yes # Comment out to remove extra log details

##################################
#
# Basic procmail recipe
#
#
# Mail is stored in /user/mail/$username/Maildir
# Configs in /user/mail/$username
# includes: .procmailrc .forward and .spamassassin
#
# Email is configured to always run again DSPAM
# SpamAssassin is optional with this procmail recipe example
#
# Check out www.cse.msu.edu/facility for more examples
#
##################################


# Check against SpamAssassin
:0fw
| spamc

# If SpamAssassin claims it is spam, filter it to the Spam folder
# First create Spam folder if it does not exist
# Then filter to Spam
:0:
* ^X-Spam-Status: Yes
{
:0 Wic
* ? test ! -f $MAILDIR/.Spam/new
| mkdir -p $MAILDIR/.Spam/new
:0
.Spam/new
}

# If DSPAM claims it is spam, filter it to the Spam folder
# First create Spam folder if it does not exist
# Then filter to Spam
:0:
* ^X-DSPAM-Result: Spam
{
:0 Wic
* ? test ! -f $MAILDIR/.Spam/new
| mkdir -p $MAILDIR/.Spam/new
:0
.Spam/new
}

# Example to show subject
# Delete any email with Flame in the subject (send it /dev/null)
:0
* ^Subject:.*Flame
/dev/null

 ---------------to here-----------------------