From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.bugs Subject: Re: bad rfc2047 encoding Date: Wed, 21 Aug 2002 19:14:48 +0200 Sender: bug-gnu-emacs-admin@gnu.org Message-ID: References: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1029950101 9819 127.0.0.1 (21 Aug 2002 17:15:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 21 Aug 2002 17:15:01 +0000 (UTC) Cc: Dave Love , bugs@gnus.org, bug-gnu-emacs@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17hZ4N-0002YF-00 for ; Wed, 21 Aug 2002 19:14:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hZ5X-0006iU-00; Wed, 21 Aug 2002 13:16:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17hZ4R-0006WC-00 for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2002 13:15:03 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17hZ4P-0006Vs-00 for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2002 13:15:02 -0400 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net ([217.13.230.178] helo=yxa.extundo.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 17hZ4O-0006Vn-00 for bug-gnu-emacs@gnu.org; Wed, 21 Aug 2002 13:15:01 -0400 Original-Received: from latte.josefsson.org (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.12.5/8.12.5) with ESMTP id g7LHEm9C026347; Wed, 21 Aug 2002 19:14:49 +0200 Original-To: =?iso-8859-1?q?Bj=F8rn?= Mork X-Hashcash: 0:020821:bmork@dod.no:f8ead2b4171adc47 X-Hashcash: 0:020821:d.love@dl.ac.uk:7d3f3a4b4d65db2e X-Hashcash: 0:020821:bugs@gnus.org:f736a8f3b0acd4a9 X-Hashcash: 0:020821:bug-gnu-emacs@gnu.org:90fc37c4d577ef0d In-Reply-To: =?iso-8859-1?q?(Bj=F8rn?= Mork's message of "Tue, 20 Aug 2002 20:22:06 +0200") Original-Lines: 45 User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (i686-pc-linux-gnu) X-MIME-Autoconverted: from 8bit to quoted-printable by yxa.extundo.com id g7LHEm9C026347 Errors-To: bug-gnu-emacs-admin@gnu.org X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.bugs:3265 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:3265 Bj=F8rn Mork writes: > And > > (with-temp-buffer > (insert "To: ") > (rfc2047-encode-message-header) > (buffer-string)) > > evaluates to > > "To: " > > 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.=20 > > 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=F8rn Mork\" ") > (rfc2047-encode-message-header) > (buffer-string)) > "From: \"=3D?iso-8859-1?q?Bj=3DF8rn?=3D Mork\" " > > RFC2047:=20 > "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.