procmail
[Top] [All Lists]

Re: egrep body & folder delivery recipe problem

2002-03-07 02:34:26
parv <parv_(_at_)yahoo(_dot_)com> writes:
...my problem is i want to deliver mail - headers+body -- only if
regex in a file match at least one body line.  otherwise, deliver
mail to junk folder.  i don't know how how to check the status code
of a pipe and still be able to have the complete message, not only
the body.

i had searched the archives, but i keep hitting upon variations of
these...

 :0:
 * B ?? <regex>
 <action>

This tells procmail to try matching the regexp <regex> against the body.
Isn't that what you wanted?  What happened when you tried this?


 :0 fw:
 | formail -I "" | egrep -f <file>

 :0 fbw:
 | egrep -f <file>

The 'f' flag on the recipe tells procmail to use the output of the action
to replace what was fed into the action (header, body, or both).  So,
the first of these feeds the entire message into the pipe, and replaces
it's copy of the message with the output of the egrep.  The second of
these feeds just the body into the action, replacing it with the egrep
output, while the header is left unchanged.


Philip Guenther
_______________________________________________
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>