procmail
[Top] [All Lists]

Re: search for 2 headers and a body

1997-09-25 08:54:46
Timothy J Luoma <luomat(_at_)peak(_dot_)org> writes:
...
How can I search for them, in the above order (Check From line, then Subject  
line, then body scan) and if they all match I want to send the body of the  
message to a special program via pipe.

I was going to do this

:0
* ^From:(_dot_)*someone(_at_)somewhere\(_dot_)com
* ^Subject: Subject
{
      :0 B
      * begin 644 file.tar.gz
      {
      
              # should this be
              # :0fb
              # rather than what it is?
              # I just want the body
              # sent to the program
              :0
              | /path/to/my/program
      }
}


the problem is that
      1) it seems inefficient
      2) it's ugly
      3) it sends the headers to 'program' (do I use 'fb'?)

You don't need either of the nested blocks:

        :0 b
        *      ^From:(_dot_)*someone(_at_)somewhere\(_dot_)com
        *      ^Subject: Subject
        * B ?? ^begin 644 file.tar.gz
        | /path/to/my/program

The 'f' flag should *ONLY* be used if the action is a program that
modifies the message/header/body being fed into it, and spits it back
out on stdout.  If you just want to feed the message into the program,
then you don't want the 'f' flag.  If you want to keep going after
feeding the program, then you're feeding a 'c'opy in the program and
you want the 'c' flag.


Philip Guenther

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