procmail
[Top] [All Lists]

inconsistent routine to grab snippet of email

2003-01-14 08:01:22
I could use some insight and tips into the following (mostly working)
snippet of code.  It's designed to find email messages that have only a
period on a line in the body of the message.

After finding that, it also shows the surrounding text with a grep -C4
command.  However, that same grep -C4 recipe also bombs out sometimes, and
while the error message says the rescue succeeded, in fact the recipe dies.

The recipe works most of the time.  My first guess is that tmp.request is
being overwritten by another simultaneous email being processed.

Does anybody have any insights on the error messsage, or a better way of
accomplishing this, so that the grep is not done on a file, but rather on
the mail buffer within procmail.

Thank you very much.

mark



:0 fhw HB
* ! ^X-Diagnostic:
* ^Content-type:.*text/plain
* ^\.$
| $formail -A "X-Diagnostic: message had line with only period"

:0 afhw
| $cat - ;  $cat error_line_with_only_dot.txt

:0 afhw
| $cat - ;  $grep -C4 "^\.$" tmp.request





procmail: Match on ! "^X-Diagnostic:"
procmail: Match on "^Content-type:.*text/plain"
procmail: Match on "^\.$"
procmail: Executing "/usr/bin/formail,-A,X-Diagnostic: message had line
with only period"
procmail: Executing " $cat - ;  $cat error_line_with_only_dot.txt"
procmail: Executing " $cat - ;  $grep -C4 "^\.$" tmp.request"
procmail: Program failure (1) of " $cat - ;  $grep -C4 "^\.$" tmp.request"
procmail: Rescue of unfiltered data succeeded




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