222
Chapter 15. Email
A thorough explanation of regular expressions is beyond the scope of this chapter. The structure of
Procmail recipes is more important, and useful sample Procmail recipes can be found at various places
on the Internet, including http://www.iki.fi/era/procmail/links.html. The proper use and adaptation of
the regular expressions found in these recipe examples depends upon an understanding of Procmail
recipe structure. Introductory information specific to basic regular expression rules can be found on
the
grep
man page.
A Procmail recipe takes the following form:
:0 flags :
lockfile name
*
special condition character
condition 1
 g 
*
special condition character
condition 2
 g 
*
special condition character
condition N
 g 
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.
15.5.2.1. 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
comparing 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 spec 
ified action is taken on it.
15.5.2.2. 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.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

tomcat hosting

 

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