procmail
[Top] [All Lists]

Re: is there any way

2000-10-07 11:38:50
I gave Douglas Hunley this advice:

| >  :0Bbfw
| >  * responded successfully$
| >  | grep -v 'responded successfully$'
| 
| and what happens if _every_ line matches that grep? do I get an empty
| email? or is procmail smart enough to not deliver the resulting message?

First, I realize that when Douglas says "every line" he surely is counting
only those with some text on them, but I do want to point out first that the
blank line at the end of the body will *never* match the expression, so grep
-v should always exit reporting success unless it fails to run at all.  Now,
to get to the question, disregarding blank lines:

I didn't think about that because I had the impression that the messages
had some leader or trailer text in their bodies, and if everything between
them had been stripped, the leader or trailer text (or both if both are
present) would still let one know what had originally been there.

If the entire body of the report is lines of "responded successfully" or "did
not respond," and on a particular occasion all queried servers respond suc-
cessfully, and you use the above recipe, then you'll get a message with
headers but an empty body.  Perhaps the subject and sender would be enough
to tip you off as to what had originally been in it.

If not, I'd say to add this recipe immediately after the previous one:

  # without `r' flag, procmail will regenerate blank line at bottom
  :0aBbfwi # if grep ran and body has no remaining printing characters
  * ! [!-~]
  | echo "Successful responses came from all servers."

| thanks for this info! made my life a lot easier...

You're welcome.  Good luck.


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