| Class
Procmail Filtering
Who
For those Professors who use a class account, but do not use the class
account email, this is a useful script.
If you have questions or need help applying it, please email
manager@cse.msu.edu
How
The general flow of this script is: Check the email against SpamAssassin.
If the email is considered spam, delete it. Check the email for viruses.
If the email is considered a virus, delete it. If deleting the email makes
you nervous, increase the SpamAssassin threshold. (documented in the script)
If the email passes both tests, then auto-respond to the sender informing
them they have reached an unmaintained email and should email their Prof
directly.
This script looks for a ~/.respond file containing the auto-response
message. If you decide later to maintain the email, delete the ~/.respond
file.
What
Include in your ~/.procmailrc
---------- cut from here ------------------
PATH=/bin:/usr/bin:/usr/bin
SPAMASSASSIN = /opt/bin/spamassassin
RESPOND=$HOME/.respond
# Grab the Subject
SUBJ_=`formail -x"Subject: " \
| expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
### after all Handin Filters ###
## If email response is bounced back to us, delete it
:0
* ^X-Loop: cse-respond
/dev/null
## SPAMASSASSIN ###
:0fw
* < 256000
| $SPAMASSASSIN -L
## if spamassassin labels email as spam, then delete it
##
## If filtering to /dev/null, modify ~/.spamassassin/user_prefs
## to include a higher "required_hists". Maybe increase from
5 to 9
:0:
* ^X-Spam-Status: Yes
/dev/null
## IF email passes spam and virus test, respond back to sender
## to email the professor directly
##
## YOU MUST
## create a ~/.respond file with a message for the autoresponse to work
##
## Maybe include a message like:
## "You have reached an unmaintained class email account. Please
## email the professor directly"
##
## It is suggested you do NOT provide the professor's email in case of
spam
:0
* !^X-Loop: cse-respond
{
:0
* ? test -f $RESPOND
|(formail -rtb -I "Precendence: respond" \
-A "X-Loop: cse-respond" \
-I "Subject: RE: ${SUBJ_}";\
cat $RESPOND)\
| $SENDMAIL -oi -t
}
------------- to here ------------------
|