procmail
[Top] [All Lists]

Re: How to avoid s/\n/ /g when unfolding a header

2004-12-16 18:52:24
Toen wij Bart Schaefer kietelden, kwam er dit uit:
Ruud H.G. van Tol:

Why not leave at least a single space where each \n was?

See section 2.2.3. of RFC 2822: "The general rule is
[...] Unfolding is accomplished by simply removing any CRLF
that is immediately followed by WSP.

The exception to this is from the MIME spec for =?Q?...?= and similar
encodings

But that is no exception, since unfolding is done first.

While encoding, an encoded token that becomes too long can simply be
split, the second part folds over to a new line (that starts with
whitespace).


(I forget which of the several MIME RFC numbers that is).

http://www.faqs.org/rfcs/rfc2047.html


In the case where you have two consecutive encoded tokens, you're
supposed to remove the whitespace from between them.

Have you seen the thread where an 'inc/snr_wild.inc' emerged? :)


The original example on this thread had an encoded token before the
folding and an unencoded one after the token, which made me decide not
to get involved in dissuading the poster from his desire to unfold in
a nonstandard way.

I tend to leave any whitespace in front of the CRLF as-is, and convert
the CRLF and all whitespace thereafter to a single space.
Often there is no whitespace in front of the CRLF, and there is only
one whitespace character (such as a tab) following the CRLF, so in that
case I remove the CRLF and change the tab into a space. That is non-
standard, but quite practical.

-- 
Grtz, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail