procmail
[Top] [All Lists]

Re: Boolean usage

1996-03-20 08:02:51
Pekka Koski <koski(_at_)rieska(_dot_)oulu(_dot_)fi> writes:

      Some friendly soul wrote an article about procmails Boolean
      usage a week or 2 ago...happened as usual, glanced at it, thought 
      "I'll never need that stuff", deleted the message and a few days 
      later ran into problems :-)

      How to make an OR-recipe?
      So a forwarding/formatting recipe accepts mail which was sent 
      "To: alias1(_at_)site" or "Cc: alias1(_at_)site" or both of them and 
then 
      proceeds {-}.

For something like this, you don't need to 'or' conditions, you just
need an 'or' in the regular expression:

:0
* ^(To|Cc):(_dot_)*alias1(_at_)site
{
<action>
}


...however this particular sort of match is so common that there's a
shorthand for it:


:0
* ^TO_alias1(_at_)site
{
<action>
}


To quote the MISCELLANEOUS section of the procmailrc(5) manpage:

MISCELLANEOUS
     If the regular expression contains `^TO_' it will be substi-
     tuted by `(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope
     |Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)', which
     should catch all destination specifications containing a
     specific _address_.


There are several other such builtin expansions, so you should read that
section for more info.


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>