Procmail Configuration
The Procmail configuration file contains important environmental variables. These variables specify things such as which messages to sort and what to do with the messages that do not match any recipes.
These environmental variables usually appear at the beginning of .procmailrc
in the following format:
<env-variable>
="<value>
"
In this example,
is the name of the variable and <env-variable>
defines the variable.
<value>
There are many environment variables not used by most Procmail users and many of the more important environment variables are already defined by a default value. Most of the time, the following variables are used:
DEFAULT
- Sets the default mailbox where messages that do not match any recipes are placed.
The default DEFAULT
value is the same as $ORGMAIL
.
INCLUDERC
- Specifies additionalrc
files containing more recipes for messages to be checked against. This breaks up the Procmail recipe lists into individual files that fulfill different roles, such as blocking spam and managing email lists, that can then be turned off or on by using comment characters in the user's.procmailrc
file.For example, lines in a user's
.procmailrc
file may look like this:MAILDIR=$HOME/Msgs INCLUDERC=$MAILDIR/lists.rc INCLUDERC=$MAILDIR/spam.rc
If the user wants to turn off Procmail filtering of their email lists but leave spam control in place, they would comment out the first
INCLUDERC
line with a hash mark character (#
).LOCKSLEEP
- Sets the amount of time, in seconds, between attempts by Procmail to use a particular lockfile. The default is eight seconds.LOCKTIMEOUT
- Sets the amount of time, in seconds, that must pass after a lockfile was last modified before Procmail assumes that the lockfile is old and can be deleted. The default is 1024 seconds.LOGFILE
- The file to which any Procmail information or error messages are written.MAILDIR
- Sets the current working directory for Procmail. If set, all other Procmail paths are relative to this directory.ORGMAIL
- Specifies the original mailbox, or another place to put the messages if they cannot be placed in the default or recipe-required location.By default, a value of
/var/spool/mail/$LOGNAME
is used.SUSPEND
- Sets the amount of time, in seconds, that Procmail pauses if a necessary resource, such as swap space, is not available.SWITCHRC
- Allows a user to specify an external file containing additional Procmail recipes, much like theINCLUDERC
option, except that recipe checking is actually stopped on the referring configuration file and only the recipes on theSWITCHRC
-specified file are used.VERBOSE
- Causes Procmail to log more information. This option is useful for debugging.
Other important environmental variables are pulled from the shell, such as LOGNAME
, which is the login name; HOME
, which is the location of the home directory; and SHELL
, which is the default shell.
A comprehensive explanation of all environments variables, as well as their default values, is available in the procmailrc
man page.