procmail
[Top] [All Lists]

Re: Procmail recipes

1997-11-21 13:52:40
Hi,
I set a simple filter up using procmail for one of my users recently. 
All email for the user comes to his address in the UNIX domain, gets
filtered through procmail and forwards the remaining email to the 
users PC mail address. 

I set up a standard procmail .forward file:
"|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #fred"

The .procmailrc file checks to see if the email is from an internal 
domain, if so emails it to PC mail address, otherwise passes mail 
through the filter, then any email that gets through the filter is 
emailed to the users PC mail address. Any undesirable email source 
address that gets through is then added to the filter. The 
.procmailrc file:
#Set on when debugging
VERBOSE=on

#Replace `mail' with your mail directory (Pine uses mail, Elm uses Mail)
MAILDIR=$HOME/Mail

#Directory for storing procmail log and rc files
PMDIR=$HOME/.procmail

#Procmail Log file
LOGFILE=$PMDIR/log

#If its local mail, its good mail
:0
* ^From:.*stratus.com
! fred(_at_)pc(_dot_)stratus(_dot_)com

#Spam filter file
INCLUDERC=$PMDIR/rc.spam

#If the message got to this point, its ok or you need to adjust the filter
:0
! fred(_at_)pc(_dot_)stratus(_dot_)com

Last, the rc.spam file was started from the list of sites that AOL blocks
at  "http://www.idot.aol.com/preferredmail/";. If AOL has trouble with these 
sites spamming them (the king of spam has trouble with spammers???), then
I won't miss them either.
The rc.spam file is of the form:
:0:
* ^TO:.*nowhere.com
/dev/null
:0:
* ^From:.*nowhere.com
/dev/null
:0:
* ^Subject:.*Advertisement*
/dev/null
:0:
* ^Received:.*www.cyberkorea.co.kr
/dev/null

You can replace the "/dev/null" with a file name to log the spam if 
you want. I try to miss few opportunities to track down the spammers 
and get their accounts pulled or aggravate SysAdmins that support 
this behavior.

I hope this helps.
   -dsc

########################################################################
# Dave Cartier                           Stratus Computer Inc.         #
# UNIX Systems Administrator             55 Fairbanks Blvd.            #
# (508) 460-2290 (Voice)                 Marlboro, MA 01752-1298       #
# (508) 460-0397 (Fax)                   dsc(_at_)sw(_dot_)stratus(_dot_)com    
        #
##########       Opinions expressed here are mine alone.      ##########
########################################################################
#      Friends help you move.  Real friends help you move bodies.      #
########################################################################

Date: Fri, 21 Nov 1997 10:24:15 -0700 (MST)
From: Jim Hribnak <hribnak(_at_)nucleus(_dot_)com>
To: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Subject: Procmail recipes

I am looking for a web site that has a list of recipes for procmail..

Particularily I am looking for a filter that will look for mail for a
certain address (ie info@<some domaion> and then forward that off to a
certain user

IE 

info(_at_)domain1(_dot_)com goes to joe(_at_)domain1(_dot_)com
info(_at_)domain2(_dot_)com foes to fred(_at_)domain2(_dot_)com
etc

Jim


<Prev in Thread] Current Thread [Next in Thread>