procmail
[Top] [All Lists]

Re: Adding custom mail headers via a filter?

2002-10-16 08:36:41
On Wed, 16 Oct 2002, Robert Nicholson wrote:

I just did this and I can say that whenever only one filter sees the
message the From_ line remains in tact. If I enable two filters and they
process the message the message after it leaves the first filter is
missing the From_ header.

Missing entirely, or has one or more characters lost (e.g. it has become
"rom ..." without the "F")?

There's a known but so far incompletely diagnosed bug where _something_
about the behavior of a filter can cause procmail to lose one character
from the beginning of the message.  What we don't know is exactly _what_
behavior causes this -- it might be that the filter exits with a nonzero
status, it might be that the filter produces output of its own on stderr,
it might be that the filter fails to read all of its input, or it might be
something else entirely; we just haven't ever gotten a confirmed report.

Complicating matters, this appears to happen only to _some builds_ of
procmail -- not builds on some platforms, or builds of some versions, but
certain individual compilations.  Sometimes recompiling procmail again on
the same platform makes the problem go away, sometimes it doesn't.

Any help you can give diagnosing this would be appreciated, but you might
have to add debugging printfs to the procmail sources (start in pipes.c),
and of course that might make the problem go away again.

The workaround, such as it is, is to find the filter recipe that causes
the breakage and put immediately after it:

:0
| sed '1s/^rom/From/'

and from there on things go back to normal (unless/until some other filter
also triggers the bug).

There actually is another known bug in pipes.c that has to do with
VAR=|command captures; an unofficial snapshot with this patched is
available at http://www.well.com/user/barts/email/.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail