Red Hat ENTERPRISE LINUX 3 Reference Manual page 193

Hide thumbs Also See for ENTERPRISE LINUX 3:
Table of Contents

Advertisement

Chapter 11. Email
recipes and useful sample Procmail recipes can be found at various places on the Internet (such as
http://www.iki.fi/era/procmail/links.html). The proper use and adaptation of regular expressions can
be derived by viewing these recipe examples. In addition, introductory information about basic regular
expression rules can be found in the
The following simple examples demonstrate the basic the structure of Procmail recipes and can pro-
vide the foundation for more intricate constructions.
A basic recipe may not even contain conditions, as is illustrated in the following example:
:0:
new-mail.spool
The first line specifies that a local lockfile is to be created but does not specify a name, so Procmail uses
the destination file name and appends the value specified in the
condition is specified, so every message matches this recipe and, therefore, is placed in the single spool
file called
new-mail.spool
variable. An MUA can then view messages in this file.
A basic recipe, such as this, can be placed at the end of all
location.
The following example matched messages from a specific email address and throws them away.
:0
* ^From: spammer@domain.com
/dev/null
With this example, any messages sent by
deleting them.
Caution
Be certain that rules are working as intended before sending messages to
deletion. If a recipe inadvertently catches unintended messages, and those messages disappear, it
becomes difficult to troubleshoot the rule.
A better solution is to point the recipe's action to a special mailbox, which can be checked from time
to time to look for false positives. Once satisfied that no messages are accidentally being matched,
delete the mailbox and direct the action to send the messages to
The following recipe grabs email sent from a particular mailing list and places it in a specified folder.
:0:
* ^(From|CC|To).*tux-lug
tuxlug
Any messages sent from the
automatically for the MUA. Note that the condition in this example matches the message if it has the
mailing list's email address on the
Consult the many Procmail online resources available in Section 11.6 Additional Resources for more
detailed and powerful recipes.
man page.
grep
, located within the directory specified by the
spammer@domain.com
tux-lug@domain.com
,
, or
From
CC
To
LOCKEXT
files to direct messages to a default
rc
are sent to the
/dev/null
mailing list are placed in the
lines.
environment variable. No
environment
MAILDIR
device,
/dev/null
for permanent
/dev/null
.
mailbox
tuxlug
175

Advertisement

Table of Contents
loading

Table of Contents