procmail
[Top] [All Lists]

filtering mail w/ procmail

1998-02-04 16:23:25
I'm _t r y i n g_ to set up procmail to filter incoming mail into folders,
i.e., Hurricane for hurricane-list(_at_)redhat(_dot_)com, Redhat for
redhat-list(_at_)redhat(_dot_)com, etc...

Whatever is happening, something is eating my mail.  Below is my .procmailrc
file if anyone would like to look it over.

# Begin .procmailrc

LOGNAME=tdukes

SHELL=/bin/sh                      

PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin
                                   
VERBOSE=on

MAILDIR=$HOME/Mail                 

DEFAULT=/var/spool/mail/$LOGNAME

LOGFILE=$MAILDIR/procmail.log      

SENDMAIL=/usr/sbin/sendmail        

FORMAIL=/usr/bin/formail           

LINEBUF=16384                      
                                   
SBDIR=$HOME/spambouncer            

ADMINFOLDER=$MAILDIR/admin.incoming  
 
BLOCKFOLDER=$MAILDIR/block.incoming  

BLOCKREPLY=SILENT

SPAMREPLY=SILENT

BULKFOLDER=$MAILDIR/bulk.incoming      

SPAMFOLDER=$MAILDIR/spam.incoming     

ALTFROM=tdukes(_at_)netside(_dot_)com         

BYPASSWD=good_message              

FREEMAIL=INTERNAL

NOLOOP=$ALTFROM                    

NOBOUNCE=$MAILDIR/nobounce

PATTERNMATCHING=SILENT

# BEGIN RECIPES

# Nuke duplicate messages
:0 Wh: msgid.lock
| $FORMAIL -D 8192 msgid.cache

# Create a backup cache of 100 most recent messages in case of mistakes
:0 c
backup

  :0 ic
  | cd backup && rm -f dummy `ls -t msg.* | sed -e 1,100d`

# Regenerate "From" lines to make sure they are valid
:0 fhw
| formail -I "From " -a "From "

# Send bounced mail and mail from admin accounts to its own folder
:0:
* (^FROM_MAILER|\
   ^From.*[^0-9A-Za-z]abuse@|\
   ^From.*[^0-9a-zA-Z]spam@)
| $FORMAIL -A"X-SpamBouncer: Admin" >>$ADMINFOLDER

# MAILING LISTS

# Filter out mail from all mailing lists you are on =before= spam
# filtering.  I included two I subscribe to and recommend highly, but
# your list will doubtless be different.  Just duplicate the recipe
# for each mailing list you are on, and put the correct address for
# the list in the condition statement.  (The "* ^TO" part.)  If you
# read mail on shell, you may find it easier to deliver this mail
# to separate folders, especially for busy lists.  I do. :)

:0: * ^From.tdukes
test

# RedHat Hurricane List
# :0:
# * ^TOhurricane-list(_at_)redhat(_dot_)com
# Hurricane
# $FORMAIL -A"X-SpamBouncer: Bulk" >>~/Mail/Hurricane

# RedHat List
# :0:
# * ^TOredhat-list(_at_)redhat(_dot_)com
# Redhat
# $FORMAIL -A"X-SpamBouncer: Bulk" >>~Mail/Redhat

# RedHat ANNOUNCE List
# :0:
# * ^TOannounce-list(_at_)redhat(_dot_)com
# ANNOUNCE
# $FORMAIL -A"X-SpamBouncer: Bulk" >>~/Mail/ANNOUNCE

# # Procmail list (Wonderful for new Procmail users!)
# :0:
# * ^TOprocmail(_at_)Informatik(_dot_)RWTH-Aachen(_dot_)DE
# Procmail
# | $FORMAIL -A"X-SpamBouncer: Bulk" >>~/Mail/Procmail

:0
* ^From.*aol.com
/dev/null

:0
* ^ToFriend(_at_)public(_dot_)com
/dev/null

# Call the Spam Bouncer to filter remaining mail for spam.
# (Comment out the statement above, and uncomment this one, if you prefer
# the full version.)
INCLUDERC=$SBDIR/sb.rc

# Sort out mail that really is to you from mail Bcc'd to you, or mail
# which doesn't have any of your email addresses on the To: or Cc: line.
# (Best Internet users -- I recommend =NOT= putting your
# login(_at_)shellx(_dot_)best(_dot_)com, 
login(_at_)nntp?(_dot_)best(_dot_)com, or 
login(_at_)shell#(_dot_)ba(_dot_)best(_dot_)com
# addresses in here if you post to Usenet from shell, since they appear in
# those posts, and spammers tend to collect them. :()
#
# This does =wonders= in keeping spam from appearing in your personal
# mail. :)
#
# Substitute your shell account email address, custom domain, and any other
email
# address you may have for the entries below.
:0:
* ^(To:|Cc:).*(tdukes(_at_)scsn\(_dot_)net|\      
         (_dot_)*(_at_)scsn\(_dot_)net|\
#         login(_at_)otherdomain\(_dot_)net)
| $FORMAIL -A"X-SpamBouncer: Default" >>$DEFAULT

# Deliver email which passed spam filtering, but which wasn't sent to
# a recognizable personal email address of yours, to your "bulk mail"
# folder, for reading on a less-urgent basis.
:0:
| $FORMAIL -A"X-SpamBouncer: Bulk" >>$BULKFOLDER

# Done :)



TIA
----------------------------------------------------------------
Red Hat Linux 5.0, kernel 2.0.33
E-Mail: tdukes(_at_)scsn(_dot_)net
Home Page: http://www.scsn.net/users/tdukes
Columbia, SC
----------------------------------------------------------------

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