You control Procmail yourself, through a file that you put in your home directory.
| Important note: If you are using some other mechanism to deliver your mail (if you have a .forward file with anything other than procmail in it) - your .procmailrc will be ignored and procmail filtering will not work. |
Side Note -- a bit of Unix trickeryThe whole trick to Procmail is writing the .procmailrc file.Files in Unix that begin with a dot '.' are hidden files. So, when you use the
lscommand to view the files in your home directory, you may not see the .procmailrc file, or any other so-called "dot-files", right away. To see hidden files in your directory, use the '-a' option, as inls -a. The '-a' stands for "all files," and will show you both hidden and visible files in one listing.
######################################################################### # # # STANDARD .PROCMAILRC TO FILTER SPAM # # # # COMPUTER SCIENCE DEPARTMENT # # COLUMBIA UNIVERSITY # # # ######################################################################### #### Customize the configuration to fit your need. ********* # ## Make sure that this file is only writable by the owner, otherwise ## procmail will not use it (considered "Suspicious" by procmail) ## and complain (silently to you) in the mail log file of the delivering ## machine. # # All folders (spam, log, procmailbackup) are in $MAILDIR/mail MAILDIR=$HOME/mail # Please empty the mail log ($MAILDIR/log) frequently because it gets very # big quickly. This file is a good place to check your filtered email to # make sure they are all spam. LOGFILE=$MAILDIR/log VERBOSE=off ##### uncomment below to keep backups of all incoming mail # # Uncomment the following 3 lines if you want to backup your mail # BEFORE filtering, please empty the folder frequently because it gets very # big, very quickly. #BACKUPSPOOL=$MAILDIR/procmailbackup #:0 c: #$BACKUPSPOOL # If email is marked with 90% or higher probability of being spam, filter it. :0: * ^X-PerlMx-Spam: Gauge=XXXXXXXXX # Put the spam in $MAILDIR/spam. # Please empty the spam folder frequently. spam ##### or you can delete it #/dev/null ############################## E N D ######################################
#### Customize the configuration to fit your need. ********* # ## Make sure that this file is only writable by the owner, otherwise ## procmail will not use it (considered "Suspicious" by procmail) ## and complain (silently to you) in the mail log file of the delivering ## machine. # # All folders (spam, log, procmailbackup) are in $MAILDIR/mail MAILDIR=$HOME/mail # Please empty the mail log ($MAILDIR/log) frequently because it gets very # big quickly. This file is a good place to check your filtered email to # make sure they are all spam. LOGFILE=$MAILDIR/log VERBOSE=off ##### uncomment below to keep backups of all incoming mail # # Uncomment the following 3 lines if you want to backup your mail # BEFORE filtering, please empty the folder frequently because it gets very # big, very quickly. #BACKUPSPOOL=$MAILDIR/procmailbackup #:0 c: #$BACKUPSPOOL # If email is marked with 60% or higher probability of being spam, filter it. :0 * ^X-PerlMx-Spam: Gauge=XXXXXX.* spam # These are Sophos spam classification strings which are currently useful. # Buy your drugs from Upper Slobovia (no offense to slobovians intended) :0 * ^X-PerlMx-Spam: .*GENERAL_MEDS_DRUGS.* spam # Chinese spam, and others :0 * ^X-PerlMx-Spam: .*CHARSET_FARAWAY.* spam # If you were using this, you might want to comment it out. # # It seems to pick up too much real mail. # # # # ...I have this account with $1M, but I need you to lend me money to get it. # :0 # * ^X-PerlMx-Spam: .*FRAUD_419.* # spam # html spam that uses graphics to get around text analysis :0 * ^X-PerlMx-Spam: .*IMGSPAM.* spam ############################## E N D ######################################
Sample .procmailrc:
# .procmailrc # routes incoming mail to appropriate mailboxes PATH=/usr/bin:/usr/local/bin MAILDIR=$HOME/mail # all mailboxes are in mail - Pine looks there by default LOGFILE=.procmail_log SHELL=/bin/sh # Put mail from foo into folder foo :0: * ^(From|Cc|To).*foo foo #all other mail goes to DEFAULT mailbox
Download
The above is example is a valid
.procmailrc file and you can just download and start using it, modifying it for your
needs. (Rename it to .procmailrc in your home directory after download.).
| Note: If you are using pop to read your mail, your mailer will not be able to access anything other than your inbox; so please use imap or local mail readers. |
If you use mh-style mail, and use .maildelivery for filtering your
mail, you can use .procmailrc to do the same thing:
Sample .procmailrc for use with mh-style mail:
Download
# .procmailrc # routes incoming mail to appropriate mailboxes PATH=/usr/bin:/usr/local/bin:/usr/local/mh/bin:/usr/lib/nmh LOGFILE=.procmail_log SHELL=/bin/sh # Put mail from foo into folder foo :0: * ^(From|Cc|To).*foo |rcvstore foo #default - should be last recipe :0: |rcvstore inbox