What is Procmail? Procmail is an email filter that runs under the Unix operating system. It is very powerful.
What is this page? This is a simple and practical introduction for beginners. My intent is to answer basic questions about how procmail works and how to use it first before you get flooded with details about the powerful things that can be done with it. I assume you have a basic knowledge of Unix.
How does it work? The basic scheme:
If you are not familiar with the notation,
a "~" signifies your home directory.
Starting a file with "." means
that is not normally visible using the ls program.
However, you can see such files by
using the -a flag:
ls -a ~/.forward |
"|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #toms"This tells the mail agent that when email arrives it should execute the procmail program. (See the unix manual page for 'forward' for information about how this works.)
# version = 1.07 of .procmailrc 2003 Aug 26 # this is a ~/.procmailrc file # # For information about this file, see # https://alum.mit.edu/www/toms/procmail.html # # www.procmail.com # # General questions: # http://www.uwasa.fi/~ts/info/proctips.html # # man page: # http://mirrors.ccs.neu.edu/cgi-bin/unixhelp/man-cgi?procmailrc # ********************************************************** # Preliminary setup # http://pm-doc.sourceforge.net/pm-tips-body.html#always_set_shell SHELL = /bin/sh # This part tells procmail the locations of various files. # You will need to change these to fit your system! # Please check if all the paths in PATH are reachable, # remove the ones that are not. PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:/opt/sfw/bin:. MAILDIR=$HOME/Mail # You'd better make sure it exists DEFAULT=/var/mail/toms LOGFILE=$MAILDIR/from LOCKFILE=$HOME/.lockmail # ********************************************************** # Controls for what to do with various kinds of email follow: # Stop listening to that stupid Joker :0 B * Choose a Prank from the list below Joker.junk
Links
Schneider Lab
origin: 2003 Aug 26
updated: version = 1.08 of procmail.html 2005 Jul 64