From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22892 invoked from network); 16 Dec 2022 23:20:35 -0000 Received: from mx1.math.uh.edu (129.7.128.32) by inbox.vuxu.org with ESMTPUTF8; 16 Dec 2022 23:20:35 -0000 Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p6K0G-008FTK-J7 for ml@inbox.vuxu.org; Fri, 16 Dec 2022 17:20:32 -0600 Received: from lists1.math.uh.edu ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.96) (envelope-from ) id 1p6K0G-004TgH-0a for ml@inbox.vuxu.org; Fri, 16 Dec 2022 17:20:32 -0600 Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtp (Exim 4.96) (envelope-from ) id 1p6JPd-004Td4-1O for ding@lists.math.uh.edu; Fri, 16 Dec 2022 16:42:41 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1p6JPa-008FKs-7O for ding@lists.math.uh.edu; Fri, 16 Dec 2022 16:42:41 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mAtp4i02aPZwgVaE64kTwc3DvCs86xZfnncwrJgnr28=; b=QkstMmIECCzrIuJ9aQsWKjzw/t kWdxsEOTSXFFyj9UDVIn5s4t7ETsZ1wtW5i0az6880I6ircoRRO6jh0wRr8AzpaPxzExhNS1u5gLa L69nHRMmUyFELPfn9IEWa2/PHX7GAFpfjwjtY5k9xcTMQeqL+sSxDx4NjLLFygxbDG6g=; Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1p6JPR-0007cE-9Q for ding@gnus.org; Fri, 16 Dec 2022 23:42:32 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671230546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mAtp4i02aPZwgVaE64kTwc3DvCs86xZfnncwrJgnr28=; b=R2QOMcx4uc0SSl2hH39TR79JGl6gZSHpaWzQ/c8+iubE8hJeBQLYOTGEbED6PXPCXyya77 uMFR+vxdqcq9+9+e5VIX2O5qLq5ALUwnUQCWzHztOLvF6BHtlHS/X7i3vjWaDrXIy/h5AC 9INUbJZz+pZZ8OzPkHGMtydZspVuMqU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-5GUdKsMRMUC5jCEPKvp3BQ-1; Fri, 16 Dec 2022 17:42:24 -0500 X-MC-Unique: 5GUdKsMRMUC5jCEPKvp3BQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F9002803D60; Fri, 16 Dec 2022 22:42:24 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.61]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5AD2440C6EC4; Fri, 16 Dec 2022 22:42:23 +0000 (UTC) From: Florian Weimer To: emacs-devel@gnu.org Cc: Lars Ingebrigtsen , ding@gnus.org Subject: Re: master ef14acf: Make nnml handle invalid non-ASCII headers more consistently References: <20210122180801.14756.84264@vcs0.savannah.gnu.org> <20210122180802.F0A1E20A10@vcs0.savannah.gnu.org> Date: Fri, 16 Dec 2022 23:42:21 +0100 In-Reply-To: <20210122180802.F0A1E20A10@vcs0.savannah.gnu.org> (Lars Ingebrigtsen's message of "Fri, 22 Jan 2021 13:08:02 -0500 (EST)") Message-ID: <874jtvq8c2.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-ID: Precedence: bulk * Lars Ingebrigtsen: > branch: master > commit ef14acfb68bb5b0ce42221e9681b93562f8085eb > Author: Lars Ingebrigtsen > Commit: Lars Ingebrigtsen > > Make nnml handle invalid non-ASCII headers more consistently > =20 > * lisp/gnus/nnml.el (nnml--encode-headers): New function to > RFC2047-encode invalid Subject/From headers (bug#45925). This > will make them be displayed more consistently in the Summary > buffer (but still "wrong" sometimes, since there's not that much > we can guess at at this stage, charset wise). > (nnml-parse-head): Use it. > --- > lisp/gnus/nnml.el | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/lisp/gnus/nnml.el b/lisp/gnus/nnml.el > index ebececa..3cdfc74 100644 > --- a/lisp/gnus/nnml.el > +++ b/lisp/gnus/nnml.el > @@ -769,8 +769,24 @@ article number. This function is called narrowed to= an article." > (let ((headers (nnheader-parse-head t))) > =09(setf (mail-header-chars headers) chars) > =09(setf (mail-header-number headers) number) > +=09;; If there's non-ASCII raw characters in the data, > +=09;; RFC2047-encode them to avoid having arbitrary data in the > +=09;; .overview file. > +=09(nnml--encode-headers headers) > =09headers)))) Unfortunately, this change in particular causes Gnus to stops storing messages into nnmail after receiving a message with this header: From: =3D?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1bykgdmlhIEVsZnV0aWxzLWRldmVs?= =3D The logged error message is: Mail source (maildir :path =E2=80=A6) failed: (error Invalid data for rfc20= 47 encoding: =E7=BD=97=E5=8B=87=E5=88=9A(Yonggang Luo) via Elfutils-devel <= elfutils-devel@sourceware.org>) On an older Emacs without this change, it seems that the original header is written to the .overview file, which sidestep the problem that not all strings are encodable by the rfc2047 functions. Thanks, Florian