220
Chapter 15. Email
quit
Quits the Fetchmail daemon process.
More commands and
.fetchmailrc
options can be found on the
fetchmail
man page.
15.5. Procmail
Procmail allows you to filter email as it is received from a remote email server, or placed in your spool
file on a local or remote email server. It is powerful, gentle on system resources, and widely used.
Procmail, commonly referred to as a Local Delivery Agent (LDA), plays a small role in delivering
email to be read by an MUA.
In order to use Procmail, it must first be installed. Type the
rpm q procmail
command to see if
the
procmail
package is installed. If, for some reason, Procmail is not on your system, install it from
the Red Hat Linux installation CD ROMs.
Procmail can be invoked in several different ways. As email is placed on your email spool file, Proc
mail can be configured to start up, filter the email to locations configured for use with your MUA, and
quit. Or, your MUA could be configured to bring up Procmail any time a message is received so that
messages are moved into their correct mailboxes. In many cases, the presence of a
.procmailrc
file
in the user's home directory will invoke Procmail, if Sendmail is being used.
The actions Procmail takes with an email are dependent upon instructions from particular recipes, or
rules, that messages are matched against by the program. If a message matches the recipe, then the
email will be placed in a certain file, deleted, or otherwise processed.
When Procmail starts, it reads the email message and separates the body from the header information.
Next, Procmail looks for the
/etc/procmailrc
file and
rc
files in the
/etc/procmailrcs
direc
tory for default, system wide, Procmail environmental variables and recipes. Then, Procmail looks for
a
.procmailrc
file in the user's home directory to find rules specific to that user. Many users also
create additional
rc
files of their own for Procmail that are referred to by their
.procmailrc
file but
may be turned on or off quickly if a mail filtering problem develops.
By default, no system wide
rc
files exist in the
/etc
directory, and no user
.procmailrc
files exist.
To begin using Procmail, you will need to construct a
.procmailrc
file with particular environment
variables and recipes explaining what you would like to do with certain messages.
In most configurations, the decision as to whether Procmail starts and attempts to filter your email is
based the existence of a user's
.procmailrc
file. To disable Procmail, but save your work on the
.procmailrc
file, move it to a similar file's name using the
mv ~/.procmailrc ~/.procmail
rcSAVE
command. When you are ready to begin testing Procmail again, change the name of the file
back to
.procmailrc
. Procmail will begin working again immediately.
15.5.1. Procmail Configuration
Procmail configuration files, most notably the user's
.procmailrc
, contain important environmental
variables. These variables tell Procmail which messages to sort, what to do with the messages that do
not match any recipes, and so on.
These environmental variables usually appear at the beginning of
.procmailrc
in the following
format:
env variable ="
value "
In this example, the
env variable
is the name of the variable, and the
value
section defines
the variable.
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