Chapter 11. Email 173The first two characters in a Procmail recipe are a colon and a zero. Various flags can be placed afterthe zero to control how Procmail processes the recipe. A colon after the ý flagsþ section specifiesthat a lockfile is created for this message. If a lockfile is created, the name can be specified by replacingýlockfile-name þ .A recipe can contain several conditions to match against the message. If it has no conditions, everymessage matches the recipe. Regular expressions are placed in some conditions to facilitate messagematching. If multiple conditions are used, they must all match for the action to be performed. Con-ditions are checked based on the flags set in the recipe’s first line. Optional special characters placedafter the * character can further control the condition.The ý action-to-performþ specifies the action taken when the message matches one of the con-ditions. There can only be one action per recipe. In many cases, the name of a mailbox is used hereto direct matching messages into that file, effectively sorting the email. Special action characters mayalso be used before the action is specified. Refer to Section 11.4.2.4 Special Conditions and Actionsfor more information about special action characters.11.4.2.1. Delivering vs. Non-Delivering RecipesThe action used if the recipe matches a particular message determines whether it is considered adelivering or non-delivering recipe. A delivering recipe contains an action that writes the message toa 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 nesting block. A nesting block is a set of actions,contained in braces { }, that are performed on messages which match the recipe’s conditions. Nestingblocks can be nested inside one another, providing greater control for identifying and performingactions on messages.When messages match a delivering recipe, Procmail performs the specified action and stops compar-ing the message against any other recipes. Messages that match non-delivering recipes continue to becompared against other recipes.11.4.2.2. FlagsFlags are essential to determine how or if a recipe’s conditions are compared to a message. Thefollowing flags are commonly used:• A — Specifies that this recipe is only used if the previous recipe without an A or a flag also matchedthis message.• a — Specifies that this recipe is only used if the previous recipe with an A or a flag also matchedthis message and was successfully completed.• B — Parses the body of the message and looks for matching conditions.• b — Uses the body in any resulting action, such as writing the message to a file or forwarding it.This is the default behavior.• c — Generates a carbon copy of the email. This is useful with delivering recipes, since the requiredaction can be performed on the message and a copy of the message can continue being processedin the rc files.• D — Makes the egrep comparison case-sensitive. By default, the comparison process is not case-sensitive.• E — While similar to the A flag, the conditions in the recipe are only compared to the message ifthe immediately preceding the recipe without an E flag did not match. This is comparable to an elseaction.• e — The recipe is compared to the message only if the action specified in the immediately precedingrecipe fails.