procmail
[Top] [All Lists]

Re: capturing the OR that succeeds ???

2004-05-14 05:41:46
On Fri, May 14, 2004 at 01:36:22PM +0200, Dallman Ross wrote:
Remember that, since you say most mail won't match, you're
going to subject most mail to all your body-grep conditions.
You can try to avoid that with various algorithmic choices.
You could pre-select for only messages that contain attachments,
and that would be the first thing I would do.  (In fact, that's
what I do do in Virus Snaggers.)  Now we can use our handy

   B ?? regex

condition lines mixed with another condition line that operates
on the message headers only:

  :0 D fw h
  * ^Content-Type:.*(multi|attach)
  * B ?? 9876543210^0 ()\/aaa
  * B ?? 9876543210^0 ()\/bbb
  * B ?? 9876543210^0 ()\/ccc
  | formail -I "X-Procmail: alphabet soup: $MATCH" 

Since a condition's default is to operate on the headers only, we didn't
need to write that first condition verbosely, though we could have:

Well, actually, that suggestion isn't optimal here because of the "D"
flag.  We're throwing out Content-Type headers that are set in nonstandard
case, unfortunately.  So now we're back to two recipes (or three, with
your subsequent one that saves the message):

 
 :0
 * ^Content-Type:.*(multi|attach)
 {
    :0 D fw h
    * B ?? 9876543210^0 ()\/aaa
    * B ?? 9876543210^0 ()\/bbb
    * B ?? 9876543210^0 ()\/ccc
    | formail -I "X-Procmail: alphabet soup: $MATCH" 
 }

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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