procmail
[Top] [All Lists]

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

2004-12-16 16:46:15
On Wed, 15 Dec 2004 01:37:46 +0100, Ruud H.G. van Tol
<rvtol(_at_)isolution(_dot_)nl> wrote:

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 (I forget which of the several MIME RFC numbers that is). In
the case where you have two consecutive encoded tokens, you're
supposed to remove the whitespace from between them.

This is actually independent of unfolding, though.  That is,

Subject: =?Q?foo?=
  =?Q?bar?=

should first unfold as

Subject: =?Q?foo?=  =?Q?bar?=

and then decode as

Subject: foobar

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.

____________________________________________________________
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