From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Francesco =?UTF-8?Q?Potort=C3=AC?= Newsgroups: gmane.emacs.bugs Subject: bug#53412: wrappin text lines is not enough, headers shoould be split too Date: Mon, 07 Mar 2022 14:11:14 +0100 Organization: The GNU project Message-ID: <875yopq559.fsf@tucano.isti.cnr.it> References: <87r19186gw.fsf@tucano.isti.cnr.it> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4153"; mail-complaints-to="usenet@ciao.gmane.io" To: 53412@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Mar 07 14:18:29 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nRDFt-0000w5-7M for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Mar 2022 14:18:29 +0100 Original-Received: from localhost ([::1]:40292 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRDFr-0007nd-Ti for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Mar 2022 08:18:27 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:49488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRD9f-0001UW-2D for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 08:12:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nRD9e-00019c-Ow for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 08:12:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nRD9e-0008Gz-FA for bug-gnu-emacs@gnu.org; Mon, 07 Mar 2022 08:12:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87r19186gw.fsf@tucano.isti.cnr.it> Resent-From: Francesco =?UTF-8?Q?Potort=C3=AC?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Mar 2022 13:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53412 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 53412-submit@debbugs.gnu.org id=B53412.164665867931748 (code B ref 53412); Mon, 07 Mar 2022 13:12:02 +0000 Original-Received: (at 53412) by debbugs.gnu.org; 7 Mar 2022 13:11:19 +0000 Original-Received: from localhost ([127.0.0.1]:52723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRD8x-0008Fz-Ie for submit@debbugs.gnu.org; Mon, 07 Mar 2022 08:11:19 -0500 Original-Received: from plesklin7.if1.ehiweb.it ([79.98.45.16]:34559) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nRD8w-0008Fp-FO for 53412@debbugs.gnu.org; Mon, 07 Mar 2022 08:11:19 -0500 Original-Received: from tucano.isti.cnr.it (tucano.isti.cnr.it [146.48.81.102]) by plesklin7.if1.ehiweb.it (Postfix) with ESMTPSA id 53CAE109847 for <53412@debbugs.gnu.org>; Mon, 7 Mar 2022 14:11:14 +0100 (CET) X-fingerprint: 4B02 6187 5C03 D6B1 2E31 7666 09DF 2DC9 BE21 6115 X-PPP-Message-ID: <20220307131114.22880.90633@plesklin7.if1.ehiweb.it> X-PPP-Vhost: potorti.it X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:228104 Archived-At: I just discovered that checking overlong text lines is not enough. Apparently calling mml-to-mime does not wrap overlong headers. If there is an overlong header, other headers which are utf-8 escaped are not sent correctly, and the recipient sees something like this: Subject: test =?utf-8?Q?=C3=A0?= b c =?utf-8?Q?=C3=AC?= Sending an identical email with long headers split into several lines makes the problem disappear. RFC 5322 mandates mail line lengths less than 998 (including CRLF), and this is apparently not enforced by mml-to-mime for headers, I suppose it should. My current workaround is: (setq overlength 500) ; should by 998 including CRLF (setq overlong-header-message "Overlong header at point: abort sending email.") (add-hook 'mail-send-hook ;; should become useless with Emacs 29 (lambda () (and (mm-long-lines-p overlength) (mml-to-mime)) ; break overlong text lines ;; Now check that no overlong headers exist (save-restriction (message-narrow-to-headers) (goto-char (point-min)) (and (search-forward-regexp (make-string overlength ?.) nil t) (error overlong-header-message))))) 90)