procmail
[Top] [All Lists]

Re: formail causing message corruption

1999-04-02 21:52:17
At 09:29 PM 4/2/99 -0500, Timothy J Luoma wrote:

I have this recipe:

REPLYTO=`formail -rtzxTo:`

:0fhw
| formail -I "X-Formail-Reply-To: $REPLYTO"

It usually works fine, but sometimes the header is inserted in the midst of  
other headers:

For example:

[snip]

Mail-Followup-To: PublicSource(_at_)public(_dot_)lists(_dot_)apple(_dot_)com
References: 
<Pine(_dot_)OBSD(_dot_)4(_dot_)05(_dot_)9904021543400(_dot_)26783-100000(_at_)xantham(_dot_)king(_dot_)net>;
 
<19990402151120(_dot_)A4816(_at_)stephenc(_dot_)wf(_dot_)net>  
<Pine(_dot_)OBSD(_dot_)4(_dot_)05(_dot_)9904021543400(_dot_)26783-100000(_at_)xantham(_dot_)king(_dot_)net>
 
<19990402140723(_dot_)B10959(_at_)requiem(_dot_)geecs(_dot_)org>  
<l03130301b32af80390b0(_at_)[209(_dot_)148(_dot_)132(_dot_)247
X-Formail-Reply-To: crow(_at_)debian(_dot_)org

]>
Mime-Version: 1.0

[snip]

Why does this happen only occasionally, and how can I fix it?

Well, at first glance, I'd guess that it came in with a damaged
References: header (with a newline or two in it) (note just before
and after your inserted X-Formail-Reply-To).  I'd suggest saving
received mail until you get a matching before-and-after-processing
pair before concluding that formail is the problem.

From the Mail-Followup-To, I'd guess that maybe your PublicSource
mailing list messes things up occasionally.  I've seen another
mailing list mess up headers for unknown reasons, but only from
certain posters, and some headers got placed in the body.

Also noteworthy:
it's hard to tell since it appears the References header was wrapped
(somewhere) from the original, but it appears to be cut after
exactly 255 non-white characters, or 256 if you don't count the
first one after the colon.  This is suspicious enough that I
suspect that's what's not being handled correctly, and the
trick will be to find where it gets mis-handled.

The first blank line signals the start of body, so the header
in your example is correctly placed according to that, and
formail is not at fault unless it CAUSED that break.

Cheers,
Stan

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