[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bad rfc2047 encoding

From: Simon Josefsson
Subject: Re: bad rfc2047 encoding
Date: Wed, 21 Aug 2002 19:14:48 +0200
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu)

Bjørn Mork <address@hidden> writes:

> And
> (with-temp-buffer
>   (insert "To: <address@hidden>")
>   (rfc2047-encode-message-header)
>   (buffer-string))
> evaluates to
> "To: <address@hidden>"
> OK, it's an illegal local part, but still... such local parts _do_
> exist.  Gnus is handling this in an ugly and non-compliant way IMHO.
> RFC2047 says: "An 'encoded-word' MUST NOT appear in any portion of an
> 'addr-spec'." It does not say that an illegal local part cancels this
> requirement. 
> I agree with Dave that the headers should be parsed to ensure that
> only comments, text and words within phrases are encoded. Other parts
> of the headers should never be encoded no matter which characters they
> contain. Gnus should instead probably warn the user about the illegal
> header content.
> Another example where Gnus fails:
> (with-temp-buffer
>   (insert "From: \"Bjørn Mork\" <address@hidden>")
>   (rfc2047-encode-message-header)
>   (buffer-string))
> "From: \"=?iso-8859-1?q?Bj=F8rn?= Mork\" <address@hidden>"
> RFC2047: 
> "An 'encoded-word' MUST NOT appear within a 'quoted-string'."

Yup, I now agree parsing the header is required.  RFC 2047 is only to
be used in some parts of the header.  I wonder if rfc822.el is up to
this though, I remember it didn't cope with non-ASCII properly at all.
Anyone want to work on it?

> In this example the quoted-string should probably be unquoted and
> then encoded. Or would that break something?

It could perhaps encode the quotes too.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]