procmail
[Top] [All Lists]

Re: Help: running a C program when mail arrives

1996-08-09 12:43:57
Alan Stebbens wrote,

| If you wish to "modify the body of the message", and pass it back, then
| use the "fb" flags (please read procmailrc(1)):

Yes, except that the procmailrc man page is in chapter 5 of the manual,
not chapter 1, so it's procmailrc(5).

| If the filterprogram exits with a 0 status (0 == okay), then procmail
| will replace the original input body with the output of the
| filterprogram.  If the filterprogram exits with anything but zero,
| procmail will report an "error" to the log, and "recover" the input (not
| filter it).

I am very sure that that's the case ONLY if you have the `w' or `W' flag on
the filtering recipe.  Without `w' or `W', procmail won't care about a bad
exit status from the filter and will replace the filtered portion with what-
ever standard output the filter produced.  It may still report an error to
the log but it won't recover the previous text.  This, for example, will
destroy the body of a message, even without `i':

 :0fb
 | false

With this, however, procmail will recover the original body:

 :0fbW # same results even if we add `i'
 | false

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