Section 16.5:Procmail
•
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 will pause 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 the INCLUDERC option, except that recipe checking is actually stopped on the referring
configuration file and only the recipes on the SWITCHRC-specified file are used.
•
VERBOSE — Causes Procmail to log much more information. This option is useful for debugging.
Other important environmental variables are pulled from your shell, such as LOGNAME, which is your
login name, HOME, which is the location of your home directory, and SHELL, which is your default
shell.
A comprehensive explanation of all environments variables, as well as their default values, is available
on the procmailrc man page.
16.5.2 Procmail Recipes
New users often find the construction of recipes the most difficult part of learning to use Procmail. To
some extent, this is understandable, as recipes do their message matching using regular expressions,
which is a particular format used to specify qualifications for a matching string. However, regular
expressions are not very difficult to construct and even less difficult to understand when read. Ad-
ditionally, the consistency of the way Procmail recipes are written, regardless of regular expressions,
makes it easy to figure out what is going on.
A thorough explanation of regular expressions is beyond the scope of this chapter. The structure of
Procmail recipes is more important, and useful sample Procmail recipes can be found at various places
on the Internet, including http://www.iki.fi/era/procmail/links.html. The proper use and adaptation of
the regular expressions found in these recipe examples depends upon an understanding of Procmail
recipe structure. Introductory information specific to basic regular expression rules can be found on
the grep man page.
A Procmail recipe takes the following form:
Figure 16–9 Structure of a Procmail recipe
:0 <flags>: <lockfile-name>
* <special-condition-character> <condition-1>
275
Need help?
Do you have a question about the LINUX 7.2 and is the answer not in the manual?
Questions and answers