276
* <special-condition-character> <condition-2>
* <special-condition-character> <condition-N>
<special-action-character><action-to-perform>
The first two characters in a Procmail recipe are a colon and a zero. Various flags can optionally
be placed after the zero to control what Procmail does when processing this recipe. A colon after
the <flags> section specifies that a lockfile will be created for this message. If a lockfile is to be
created, you specify its name in the <lockfile-name> space.
A recipe can contain several conditions to match against the message. If it has no conditions, every
message will match the recipe. Regular expressions are placed in some conditions in order to facilitate
a match with a message. If multiple conditions are used, they must all match in order for an action to
be performed. Conditions are checked based on the flags set in the recipe's first line. Optional special
characters placed after the * character can further control the condition.
The <action-to-perform> specifies what is to happen to a message if it matches one of the
conditions. There can only be one action per recipe. In many cases, the name of a mailbox is used
here to direct matching messages into that file, effectively sorting the email. Special action characters
may also be used before the action is specified.
Delivering vs. Non-Delivering Recipes
The action used if the recipe matches a particular message determines whether recipe is considered
delivering or non-delivering. A delivering recipe contains an action that writes the message to a
file, sends the message to another program, or forwards the message to another email address. A
non-delivering recipe covers any other actions, such as when a nesting block is used. A nesting block
is an action contained in braces { } that designates additional actions to perform on messages that
match the recipe's conditions. Nesting blocks can be nested, providing greater control for identifying
and performing actions on messages.
Delivering recipes that match messages causes Procmail to perform the action specified and stop com-
paring the message against any other recipes. Messages that match conditions in non-delivering recipes
will continue to be compared against other recipes in the current and following rc files. In other words,
non-delivering recipes cause the message to continue through the recipes after the specified action is
taken on it.
Flags
Flags are very important in determining how or if a recipe's conditions are compared to a message.
The following flags are commonly used:
•
A — Specifies that this recipe will only be used if the last previous recipe without an A or a flag
also matched this message.
Chapter 16:Email
Need help?
Do you have a question about the LINUX 7.2 and is the answer not in the manual?
Questions and answers