From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#38200: 26.2; sendmail.el needlessly munging headers by inserting backslashes Date: Thu, 14 Nov 2019 05:59:37 +0100 Message-ID: <87woc3rr2e.fsf@gnus.org> References: <20191113215108.EA66E203EC@alderaan.gsfc.nasa.gov> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="197258"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Katsumi Yamaoka , 38200@debbugs.gnu.org To: Ed Sabol Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 14 06:03:07 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iV7He-000pAY-VF for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2019 06:03:07 +0100 Original-Received: from localhost ([::1]:53422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iV7Hd-0004ho-LG for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Nov 2019 00:03:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38346) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iV7Fg-0003Fo-Mj for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 00:01:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iV7Ff-0008HA-D0 for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 00:01:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51765) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iV7Ff-0008Gh-6O for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 00:01:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iV7Fe-0007Yp-Ij for bug-gnu-emacs@gnu.org; Thu, 14 Nov 2019 00:01:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Nov 2019 05:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38200 X-GNU-PR-Package: emacs Original-Received: via spool by 38200-submit@debbugs.gnu.org id=B38200.157370761428919 (code B ref 38200); Thu, 14 Nov 2019 05:01:02 +0000 Original-Received: (at 38200) by debbugs.gnu.org; 14 Nov 2019 05:00:14 +0000 Original-Received: from localhost ([127.0.0.1]:60586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV7EV-0007Uj-Q6 for submit@debbugs.gnu.org; Wed, 13 Nov 2019 23:59:52 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:48780) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iV7ET-0007UV-RC for 38200@debbugs.gnu.org; Wed, 13 Nov 2019 23:59:50 -0500 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iV7EI-0000Mj-Gm; Thu, 14 Nov 2019 05:59:41 +0100 In-Reply-To: <20191113215108.EA66E203EC@alderaan.gsfc.nasa.gov> (Ed Sabol's message of "Wed, 13 Nov 2019 16:51:08 -0500 (EST)") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:171524 Archived-At: Ed Sabol writes: > 1. Evaluate the following: > (setq mail-user-agent 'sendmail-user-agent) > (setq send-mail-function 'sendmail-send-it) [...] > "LastName\, FirstName I. \(CODE-999.9\)\[CONTRACTING COMPANY INC\]" > > > It should like like this: > > "LastName, FirstName I. (CODE-999.9)[CONTRACTING COMPANY INC]" > This isn't due to sendmail or anything, but because (defcustom rfc2047-header-encoding-alist [...] ("\\(Resent-\\)?\\(From\\|Cc\\|To\\|Bcc\\|\\(In-\\)?Reply-To\\|Sender\ \\|Mail-Followup-To\\|Mail-Copies-To\\|Approved\\)" . address-mime) and (when (eq method 'address-mime) (rfc2047-quote-special-characters-in-quoted-strings)) > At some point, something in sendmail.el changed between Emacs version > 21.2 and 26.2 that resulted in these backslashes being > added. According to RFC822 and other email standards, these > backslashes are not needed. Emacs should not be modifying the headers > of emails needlessly. I've been perusing the relevant RFCs, but I can't find anything about having to quote commas and parentheses in quoted-strings. It's not disallowed, either -- the RFC says 3.2.1. Quoted characters Some characters are reserved for special interpretation, such as delimiting lexical tokens. To permit use of these characters as uninterpreted data, a quoting mechanism is provided. quoted-pair = ("\" (VCHAR / WSP)) / obs-qp Where any quoted-pair appears, it is to be interpreted as the character alone. That is to say, the "\" character that appears as part of a quoted-pair is semantically "invisible". so you can put a backslash in anywhere you want, basically, and it should make no semantic difference. But I'm not sure why this was added (in 2006). Perhaps some MTAs/MUAs react negatively to having those characters unquoted in strings? It looks like this was added by Katsumi, but the changelog doesn't say what problem it's trying to fix. Katsumi, do you remember? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no