# A SAMPLE .PROCMAILRC FILE FOR NOVICES
# Written by Catherine Hampton <ariel@spambouncer.org>
# Version 1.6
# Updated 11/01/02
#
# NOTE: THIS SAMPLE PROCMAIL CONFIGURATION FILE IS NOT PART OF
# THE OFFICIAL SPAMBOUNCER DISTRIBUTION.  IT IS PROVIDED AS A
# CONVENIENCE FOR THOSE WHO ARE UNFAMILIAR WITH PROCMAIL.
#
# Those who know Procmail can write their own .procmailrc files
# or customize this to their heart's content. :)
#
# Released to the Public Domain.
#
#
# SET VARIABLES

# Internal Variables

SHELL=/bin/sh               #Shell used to run procmail.  Be sure this points to
                            #your system's copy of sh.  DO NOT substitute a
                            #different shell unless you really know UNIX

LINEBUF=4096                #Needed to keep Procmail from choking on long
                            #"recipes", or instructions on what to do with
                            #particular kinds of email.

PATH=$HOME/bin:/bin:/usr/bin:/usr/local/bin
                            #Path for your programs -- this is probably best
                            #left alone.

VERBOSE=off                 #Change this to "on" when you try a new recipe
                            #so that Procmail will log literally every step
                            #it takes.  DO NOT LEAVE IT ON, though, because
                            #it creates huge logfiles.

# Default Program & file locations

MAILDIR=${HOME}/Mail              #Make sure this directory exists.  You should also create
                                  #the directory ${MAILDIR}/backup at this time.

DEFAULT=/var/mail/${LOGNAME}      #Your default incoming mailbox.  If your system sets
                                  #the LOGNAME variable, and your incoming mailbox is
                                  #located in /var/mail, leave this alone.  Your system
                                  #may also store incoming mailboxes in /var/spool/mail
                                  #or elsewhere -- PLEASE CHECK! This variable MUST be
                                  #set properly, or procmail will eat your email for
                                  #lunch.  You don't want that. :)

ADMINFOLDER=${MAILDIR}/admin.incoming  #for bounced mail, mail from root,
                                     #postmaster, abuse, etc. Change this to
                                     #${DEFAULT} if you use a POP3-based email program, such
                                     #as Eudora, Pegasus Mail, Netscape, or Microsoft
                                     #Outlook.  (I recommend against Microsoft Outlook;
                                     #it is the least secure of the programs I mentioned.)

BULKFOLDER=${MAILDIR}/bulk.incoming    #for bulk mail which appears legitimate, such
                                     #as mail from mailing lists or mail sent using
                                     #Bcc:  Change this to ${DEFAULT} if you use
                                     #a POP3-based email program.

LOGFILE=${MAILDIR}/log        #Logs message disposition.  Recommended -- otherwise
                              #all errors are emailed to you one at a time.  This
                              #gets annoying fast, since many "errors" are expected
                              #and don't require you to take action.

FORMAIL=/usr/local/bin/formail #Needed for autoreply recipes.  Modify this to point to
                               #your system's copy of formail.

SENDMAIL=/usr/sbin/sendmail    #useful for autoreply recipes.  Modify this to point
                               #to your system's copy of sendmail.

# SpamBouncer settings
#
# You can ignore these if you aren't installing the SpamBouncer.
# If you are installing the SpamBouncer, PLEASE BE SURE TO READ
# the installation instructions at <http://www.spambouncer.org/>.

ALTFROM=otheremail@othersite.com     #An alternate email address to use for sending
                                     #spam complaints and blocked email notices.  You
                                     #probably do not want to use your normal email address
                                     #for this, because you don't want to risk giving your
                                     #normal email address to a spammer.  I recommend
                                     #using a throwaway account at a free email provider
                                     #for this purpose, and just closing it and opening
                                     #another when it starts to get spammed excessively, as
                                     #it will in time.

BLOCKFOLDER=${MAILDIR}/block.incoming  #For email that is probably spam, but might not be.
                                     #The SpamBouncer stores a copy of all blocked email
                                     #in this location.

BLOCKREPLY=SILENT                    #SILENT tells the SpamBouncer to just filter
                                     #blocked email, and not reply to it.
                                     #NOTIFY tells the SpamBouncer to tell the
                                     #sender that his/her email was blocked, and
                                     #tells them how to bypass the filter if their
                                     #email is legitimate.

BYPASSWD=vX*(;P!U                    #Password that allows people who send you
                                     #legitimate email, but whose email is
                                     #blocked for some reason by the SpamBouncer,
                                     #to bypass the SpamBouncer.

FREEMAIL=INTERNAL                    #Tells the SpamBouncer whether to filter
                                     #email from sites which offer free email
                                     #addresses, and which list to use.

MYEMAIL=${HOME}/.myemail             #Tells the SpamBouncer all email addresses that
                                     #belong to you.  Useful for distinguishing personal
                                     #from bulk email.  You can change this to point to
                                     #any path and filename as long as the path is local,
                                     #the file exists, and the file is of the proper
                                     #text format.

LEGITLISTS=${HOME}/.legitlists       #Tells the SpamBouncer where your LEGITLISTS
                                     #file is located.  This file contains the email
                                     #addresses of legitimate bulk mailing lists to which
                                     #you are subscribed. You can change this to point to
                                     #any path and filename as long as the path is local,
                                     #the file exists, and the file is of the proper
                                     #text format.

LOCALHOSTFILE=${HOME}/.localhostfile #Tells the SpamBouncer where your LOCALHOSTFILE
                                     #file is located.  This file contains the domain names
                                     #that are local to you -- that is, the domains names
                                     #at which you have email addresses that this SpamBouncer
                                     #installation will process. You can change this to point to
                                     #any path and filename as long as the path is local,
                                     #the file exists, and the file is of the proper
                                     #text format.

NOBOUNCE=${HOME}/.nobounce           #Tells the SpamBouncer where your NOBOUNCE
                                     #file is located.  This file contains the email
                                     #addresses of people with whom you regularly correspond,
                                     #and whose email should not be filtered by the SpamBouncer
                                     #except for viruses and dangerous content. You can
                                     #change this to point to any path and filename as long
                                     #as the path is local, the file exists, and the file is
                                     #of the proper text format.

NOLOOP=${ALTFROM}                    #Setting for email address used in X-Loop:
                                     #header, a header which should prevent
                                     #mailing loops.  Leave this alone unless
                                     #you know what you're doing.

PATTERNMATCHING=SILENT               #Enables the SpamBouncer's Pattern Matching
                                     #filter.  NONE disables the filter; SILENT
                                     #causes it to filter out suspected spam
                                     #but not notify the senders; NOTIFY causes it
                                     #to both filter out suspected spam and notify
                                     #the sender exactly as for other blocked email.

SBDIR=${HOME}/spambouncer            #Directory where SpamBouncer program files
                                     #are located.  Edit this to point to that
                                     #directory on your system.

SPAMFOLDER=${MAILDIR}/spam.incoming  #change this to SPAMFOLDER=/dev/null
                                     #to delete spam entirely.

SPAMREPLY=SILENT                     #SILENT tells the SpamBouncer to filter spam,
                                     #but not attempt to autocomplain about it.
                                     #BOUNCE tells the SpamBouncer to send a
                                     #"MAILER-DAEMON" bounce message to the spammer.
                                     #COMPLAIN tells the SpamBouncer to send an
                                     #autocomplaint to the spammer's postmaster and
                                     #upstream sites.  BOTH tells the SpamBouncer to
                                     #send both a bounce to the sender and complain
                                     #to the spammer's postmaster.

# BEGIN RECIPES

# Create a backup cache of 100 most recent messages in case of mistakes.
# For this to work, you must first create the directory
# ${MAILDIR}/backup.
: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 "


# 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.)

# List Mom mail (GREAT list for mailing list managers)
:0:
* ^TOlistmom-talk@skyweyr.com
| ${FORMAIL} -A"X-Folder: Bulk" >>${BULKFOLDER}

# Procmail list (Wonderful for new Procmail users!)
:0:
* ^TOprocmail@Informatik.RWTH-Aachen.DE
| ${FORMAIL} -A"X-Folder: Bulk" >>${BULKFOLDER}


# Call the SpamBouncer to filter remaining mail for spam.  Comment out
# the first INCLUDERC below and uncomment the second if you are using
# the beta version of the SpamBouncer.

INCLUDERC=${SBDIR}/sb.rc
#INCLUDERC=${SBDIR}/sb-new.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.
# For this to work properly, you must create a text file named .myemail
# in your home directory and enter all email addresses that belong to
# you in it, one per line, just as you do with your .nobounce file.
#
# 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:
* ? test -f ${MYEMAIL} && \
    (${FORMAIL} -zxTo: -zxCc: |\
    fgrep -i -f ${MYEMAIL})
| ${FORMAIL} -A"X-Folder: 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-Folder: Bulk" >>${BULKFOLDER}

# Done :)
