Chapter 15. Email
221
Many environment variables are not used by most Procmail users, and many of the more important
environment variables are already defined a default value. Most of the time, you will be dealing with
the following variables:
DEFAULT
Sets the default mailbox where messages that do not match any recipes will be placed.
The default
DEFAULT
value is the same as
$ORGMAIL
.
INCLUDERC
Specifies additional
rc
files containing more recipes for messages to be checked
against. This allows you to break up your 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, two 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 would like to turn off the Procmail filtering of their email lists but leave spam control in
place, they could simple comment out the first
INCLUDERC
line with a
#
character.
LOCKSLEEP
Sets the amount of time, in seconds, between attempts by Procmail to use a partic
ular 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 will assume that the lockfile is simply old and can be deleted. The default
is 1024 seconds.
LOGFILE
The location and file to contain any Procmail informational or error messages.
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.
15.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. Addi
tionally, the consistency of the way Procmail recipes are written, regardless of regular expressions,
makes it easy to figure out what is going on.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved