# File Name:   .procmailrc 
# Purpose:     Configuration file for procmail
# Author:      helpdesk@stat.rice.edu
# Date:        $Date: 2002/08/05 14:30:49 $
#
# How to use this file:
# 
# 1). Save this dile as .procmailrc under your home directory.
# 2). Determine your mail folder. If it is not ~/Mail, change
#       MAILDIR=${HOME}/Mail
#     accordingly.
# 3). Add your own receipts to the second part.
# 4). Save http://www.stat.rice.edu/~helpdesk/dotfiles/.forward as
#     .forward under your home directory to activate mail filtering.
# 
# Recommended Readings:
#   Basic introduction, regular expression:
#      http://www.umbi.umd.edu/computing/procmail.html  
#   more about options, kind of a manual
#      http://www.redhat.com/docs/manuals/linux/RHL-7.2-Manual/ref-guide/s1-email-procmail.html
#   more about receipts
#      http://www.ccs.neu.edu/groups/systems/howto/howto-procmail.html 
#      http://www.uwasa.fi/~ts/info/proctips.html
#
# Part One: General Definitions:
# 
SHELL=$SHELL
LINEBUF=4096
PATH=/bin:/usr/bin:/usr/local/bin:$HOME/bin
VERBOSE=off
FORMAIL=/usr/local/bin/formail

MAILDIR=${HOME}/Mail        # Your Mail directory. ~/Mail is what pine uses.
                            # Change it to ${HOME}/mail if you are using
                            # ~/mail to store your mails.

DEFAULT=$ORGMAIL            # Leave mail untouched if no rule applies to it
                            # You can change it to ${HOME}/Mail/inbox too.
                            # $ORGMAIL is by default /var/mail/username

LOGFILE=${HOME}/.proclog    # Logs message disposition. Recommended -- otherwise
                            # errors are emailed to you. :/

LOGABSTRACT=all             # Log what procmail did to each email. Very useful.
                            # See $LOGFILE for the abstract.

# Part Two: Recipes
# 
# General ideas about recipes:
#
# A Procmail recipe takes the following form:
# 
#      :0<flags>: <lockfile-name>
#      
#      # zero or more conditions
#      * <special-condition-character> <condition-1>
#      * <special-condition-character> <condition-2>
#      * <special-condition-character> <condition-N>
#      
#      # One action line. Can be a Block for further filtering
#      <special-action-character><action-to-perform>
#
# Note:
#  * <conditions> are regular expressions defined in "egrep".
#  * Useful <flags>:
#    B   Parse the body of the message and look for matching conditions.
#        Only the head of the emails are processed by default.
#    c   Generate a carbon copy of the email. This is useful with 
#        delivering recipes, since the required action can be performed
#        on the message and a copy of the message can continue being 
#        processed in the rc files.
#  * Useful <special-condition-character>
#    !   Inverts the condition.
#    <   Checks to see if the message is under the specified number of bytes.
#    >   Checks to see if the message is over a particular number of bytes.
#  * Useful <special-action-character>
#    !   Tells Procmail to forward the message to the specified email addresses
#    $   Refers to a variable set earlier in the rc file. This is usually 
#        used to set a common mailbox that will be referred to by various recipes.
#    |    The pipe character tells Procmail to start a specific program
#        to deal with this message.
#    { and } Constructs a nesting block, used to contain additional 
#        recipes to apply to matching messages
#

# Eample 1: archieve your emails to ${MAILDIR}/backup/MonthYear
# (To make use of this receipt, uncomment the following two lines.)

#         :0c:
#         backup/`date +%h%y`

#  Note:
#    * You NEED to create a directory ~/Mail/backup.
#    * Without a condition, every email will be processed.
#    * with a 'c' as option, this recipes will use a copy
#      so email will continue to be processed.
#    * This recipe will add your email to a differnt archieve 
#      mailbox each month, for example "backupMar02". 

# Example2: filtering (most useful)
#
# Put emails into different folders according to 
#   a) Where it from
#   b) To whom. (for example: To a mailing list you subscribed )
#   c) Subject
#   d) Message body if you use B option. 


#         #WinBUGS mailing list
#         :0:
#         * ^(To|Cc):.*BUGS
#         ML.WinBUGS


# Example3: Forward mail
# 
# You might want to forward some or all your emails to another 
# account. A .forward file can forward ALL your emails but 
# procmail can let you forward email selectively and with more
# control.

#         :0c:
#         ! youraccount@yahoo.com


#  Note:
#    * 'c' option will leave a copy at stat.rice.edu
#    * You would better put this recipe before all others

# Example4: Stop spam
#
# If you are spamed by some email address or you just do not want to
# read email from certain address.

#         :0
#         * ^From:.*(cloudnine|ghena|zodrow)
#         Trash

# Note:
#    If you change the last line to 
#            /dev/null
#    spam emails will be perminantly deleted.