Red Hat LINUX 7.2 Reference Manual page 279

Hide thumbs Also See for LINUX 7.2:
Table of Contents

Advertisement

Section 16.5:Procmail
The first line starts the recipe by specifying that a local lockfile is to be created but does not specify
a name, leaving Procmail to use the destination filename and the LOCKEXT to name it. No condition
is specified, so every message will match this recipe and, therefore, will be placed in the single spool
file called new-mail.spool, located within the directory specified by the MAILDIR environment
variable. An MUA can then view the messages in this file.
This basic recipe could go at the end of all rc files to direct messages to a default location. A more
complicated example might grab messages from a particular email address and throw them away, as
can be seen in Figure 16–11, Example of email sent to /dev/null .
Figure 16–11 Example of email sent to /dev/null
:0
* ^From: spammer@domain.com
/dev/null
With this example, any messages sent by spammer@domain.com are immediately moved to
/dev/null, deleting them.
Be very careful that a rule is working correctly before moving messages
matching it to /dev/null, which is a permanent deletion. If your recipe
conditions inadvertently catch unintended messages, you will not even know
you are missing those messages unless the sender tells you.
A better solution is to point the recipe's action to a special mailbox that you
can check from time to time in order to look for false positives, or messages
that inadvertently matched the conditions. Once you are satisfied that no
messages are accidentally being matched, you can delete the mailbox and
direct the action to send the messages to /dev/null.
Procmail is primarily used as a filter for email, automatically placing it in the right place so that you
do not have to sort it manually. The recipe in Figure 16–12, Example of list filtering grabs email sent
from a particular mailing list and puts in the correct folder for you.
Figure 16–12 Example of list filtering
:0:
* ^(From|CC|To).*tux-lug
tuxlug
CAUTION
279

Advertisement

Table of Contents
loading

This manual is also suitable for:

Linux 7.2

Table of Contents