From unknown Sun Aug 17 22:02:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#77776: 31.0.50; rfc6068-parse-mailto-url may fail with inhibit-eol-conversion Resent-From: Kazuhiro Ito Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 13 Apr 2025 11:10:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 77776 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 77776@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174454255032083 (code B ref -1); Sun, 13 Apr 2025 11:10:05 +0000 Received: (at submit) by debbugs.gnu.org; 13 Apr 2025 11:09:10 +0000 Received: from localhost ([127.0.0.1]:39878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3vD1-0008LA-K2 for submit@debbugs.gnu.org; Sun, 13 Apr 2025 07:09:09 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37032) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3vCx-0008Hm-TV for submit@debbugs.gnu.org; Sun, 13 Apr 2025 07:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u3vCZ-0002JS-29 for bug-gnu-emacs@gnu.org; Sun, 13 Apr 2025 07:08:42 -0400 Received: from mta-sp-e02.auone-net.jp ([175.135.255.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u3vCS-0000G9-Lt for bug-gnu-emacs@gnu.org; Sun, 13 Apr 2025 07:08:38 -0400 Received: from mta-snd-e06.auone-net.jp by mta-sp-e02.auone-net.jp with ESMTP id <20250413110821293.BRDE.51148.mta-snd-e06.auone-net.jp@mta-sp-e02.auone-net.jp>; Sun, 13 Apr 2025 20:08:21 +0900 Received: from kzhr.d1.dion.ne.jp by mta-snd-e06.auone-net.jp with ESMTP id <20250413110821189.JWRI.54425.kzhr.d1.dion.ne.jp@mta-snd-e06.auone-net.jp>; Sun, 13 Apr 2025 20:08:21 +0900 Date: Sun, 13 Apr 2025 20:08:20 +0900 Message-ID: <851ptwtj2z.wl--xmue@d1.dion.ne.jp> From: Kazuhiro Ito User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Sun_Apr_13_20:08:20_2025-1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=d1.dion.ne.jp; s=default-1; t=1744542501; bh=/h5vtvZskiTvl/giB5Tf3TTWI21I/Nl0o6e2cDd8WMs=; h=Date:From:To:Subject; b=c3oCgPqMRhZp/v51VY+0DzR31fXi1tlgf3UgNoPOeTXGJfBpv9iJzZWEzbQu+c1IxQG9ZXKu YZMRZ3QhaSvbaGx6veNdtGGYXx14eXk1zpOcDUKDcDAu9RonK4zHsfCj00fsi9U38ypE8fxq1+ 3UkaGMwCjhMhvWoJHeWDKL8kshNvjtNFh3t2LvgH1r3WJxfae7NN1BzxpLjmBXkQIN5myWYe89 t5mu+4cjwZzkkN6ga480MTI5+6T8+ty+d+4+mn/xIZCSnukvpLIXnBlZjDh50jlbQ4RNuCdqu8 atnDlufIROP9TVkp0kHsqKGE8ZjKTCqN0ToyIEeT7Xh6QLUQ== Received-SPF: pass client-ip=175.135.255.2; envelope-from=kzhr@d1.dion.ne.jp; helo=mta-sp-e02.auone-net.jp X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Multipart_Sun_Apr_13_20:08:20_2025-1 Content-Type: text/plain; charset=US-ASCII Following code returns unexpected result. (let ((inhibit-eol-conversion t)) (require 'rfc6068) (rfc6068-parse-mailto-url (concat "mailto:infobot@example.com?body=" "send%20current-issue%0D%0Asend%20index"))) -> (("To" . "infobot@example.com") ("Body" . "send current-issue^M send index")) Expected result is -> (("To" . "infobot@example.com") ("Body" . "send current-issue send index")) Furthermore, if URL contains "%0D%0A" and "%0A", though it is not compliant with RFC 6068, "%0D%0A" may be decoded CRLF, not LF. -- Kazuhiro Ito --Multipart_Sun_Apr_13_20:08:20_2025-1 Content-Type: text/plain; type=patch; name="0001-Fix-rfc6068-parse-mailto-url-with-inhibit-eol-conver.patch"; charset=US-ASCII Content-Disposition: attachment; filename="0001-Fix-rfc6068-parse-mailto-url-with-inhibit-eol-conver.patch" Content-Transfer-Encoding: 7bit >From a4905fa8a369a30f691866b4e68fa11ea9cbc9e4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Ito Date: Sun, 13 Apr 2025 20:00:44 +0900 Subject: [PATCH] Fix rfc6068-parse-mailto-url with inhibit-eol-conversion * lisp/mail/rfc6068.el (rfc6068-parse-mailto-url): Fix EOL type to CRLF and never inhibit EOL conversion in decoding. --- lisp/mail/rfc6068.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/mail/rfc6068.el b/lisp/mail/rfc6068.el index 8f0b4234410..cfa51196000 100644 --- a/lisp/mail/rfc6068.el +++ b/lisp/mail/rfc6068.el @@ -39,7 +39,8 @@ rfc6068-unhexify-string (buffer-string)))) (if inhibit-decode string - (decode-coding-string string 'utf-8)))) + (let (inhibit-eol-conversion) + (decode-coding-string string 'utf-8-dos))))) (defun rfc6068-parse-mailto-url (mailto-url) "Parse MAILTO-URL, and return an alist of header-name, header-value pairs. -- 2.45.1 --Multipart_Sun_Apr_13_20:08:20_2025-1-- From unknown Sun Aug 17 22:02:20 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Kazuhiro Ito Subject: bug#77776: closed (Re: bug#77776: 31.0.50; rfc6068-parse-mailto-url may fail with inhibit-eol-conversion) Message-ID: References: <86zfgc6xj0.fsf@gnu.org> <851ptwtj2z.wl--xmue@d1.dion.ne.jp> X-Gnu-PR-Message: they-closed 77776 X-Gnu-PR-Package: emacs Reply-To: 77776@debbugs.gnu.org Date: Sat, 19 Apr 2025 14:24:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1745072642-2010-1" This is a multi-part message in MIME format... ------------=_1745072642-2010-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #77776: 31.0.50; rfc6068-parse-mailto-url may fail with inhibit-eol-convers= ion which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 77776@debbugs.gnu.org. --=20 77776: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D77776 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1745072642-2010-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 77776-done) by debbugs.gnu.org; 19 Apr 2025 14:23:12 +0000 Received: from localhost ([127.0.0.1]:35019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6967-0000Rb-Gu for submit@debbugs.gnu.org; Sat, 19 Apr 2025 10:23:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54208) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6964-0000RL-Lc for 77776-done@debbugs.gnu.org; Sat, 19 Apr 2025 10:23:09 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u695x-0005cT-HK; Sat, 19 Apr 2025 10:23:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=SShj21/WMC5/mjlIMqwqsQ4+Zm06yITi0LfrHzdbj9M=; b=GTF2hJuQ8P9A PxGIZEbmhZSLlXdFjFIL/xeDNn4NFHMqej3KImk5SI584ky1hPXcG/uS4RM559NjObkCT7QeT+p8d xAV1M5WlLnXlxAInedSKcUNWUBywGmJ/qt/RzYyxni72rlc3Hh/Lol2NO+Kae0oG/MD8GBASfWzRA PnWL9MSlFVHmzMEgoHQ87cPLJEr7ihZ0Mn9Pks99jmQ+IowSOXUPkMyl73UHeeDhn5HUF5B55Sbl5 WkDi0LQClLLLOhpt50RQBJ07UnYUGhTi9KmYI/TE8MtIs7VDtIDlKkmMcBz+tWEq6qnxkj16Jif7G qrNoXa13nS6857/u4xjU5A==; Date: Sat, 19 Apr 2025 17:22:59 +0300 Message-Id: <86zfgc6xj0.fsf@gnu.org> From: Eli Zaretskii To: Kazuhiro Ito In-Reply-To: <851ptwtj2z.wl--xmue@d1.dion.ne.jp> (message from Kazuhiro Ito on Sun, 13 Apr 2025 20:08:20 +0900) Subject: Re: bug#77776: 31.0.50; rfc6068-parse-mailto-url may fail with inhibit-eol-conversion References: <851ptwtj2z.wl--xmue@d1.dion.ne.jp> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77776-done Cc: 77776-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 13 Apr 2025 20:08:20 +0900 > From: Kazuhiro Ito > > Following code returns unexpected result. > > (let ((inhibit-eol-conversion t)) > (require 'rfc6068) > (rfc6068-parse-mailto-url > (concat "mailto:infobot@example.com?body=" > "send%20current-issue%0D%0Asend%20index"))) > > -> (("To" . "infobot@example.com") ("Body" . "send current-issue^M > send index")) > > Expected result is > > -> (("To" . "infobot@example.com") ("Body" . "send current-issue > send index")) > > Furthermore, if URL contains "%0D%0A" and "%0A", though it is not > compliant with RFC 6068, "%0D%0A" may be decoded CRLF, not LF. Thanks, installed on the master branch, and closing the bug. ------------=_1745072642-2010-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 13 Apr 2025 11:09:10 +0000 Received: from localhost ([127.0.0.1]:39878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u3vD1-0008LA-K2 for submit@debbugs.gnu.org; Sun, 13 Apr 2025 07:09:09 -0400 Received: from lists.gnu.org ([2001:470:142::17]:37032) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u3vCx-0008Hm-TV for submit@debbugs.gnu.org; Sun, 13 Apr 2025 07:09:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u3vCZ-0002JS-29 for bug-gnu-emacs@gnu.org; Sun, 13 Apr 2025 07:08:42 -0400 Received: from mta-sp-e02.auone-net.jp ([175.135.255.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u3vCS-0000G9-Lt for bug-gnu-emacs@gnu.org; Sun, 13 Apr 2025 07:08:38 -0400 Received: from mta-snd-e06.auone-net.jp by mta-sp-e02.auone-net.jp with ESMTP id <20250413110821293.BRDE.51148.mta-snd-e06.auone-net.jp@mta-sp-e02.auone-net.jp>; Sun, 13 Apr 2025 20:08:21 +0900 Received: from kzhr.d1.dion.ne.jp by mta-snd-e06.auone-net.jp with ESMTP id <20250413110821189.JWRI.54425.kzhr.d1.dion.ne.jp@mta-snd-e06.auone-net.jp>; Sun, 13 Apr 2025 20:08:21 +0900 Date: Sun, 13 Apr 2025 20:08:20 +0900 Message-ID: <851ptwtj2z.wl--xmue@d1.dion.ne.jp> From: Kazuhiro Ito To: bug-gnu-emacs@gnu.org Subject: 31.0.50; rfc6068-parse-mailto-url may fail with inhibit-eol-conversion User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?ISO-8859-4?Q?Goj=F2?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/31.0.50 (x86_64-w64-mingw32) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: multipart/mixed; boundary="Multipart_Sun_Apr_13_20:08:20_2025-1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=d1.dion.ne.jp; s=default-1; t=1744542501; bh=/h5vtvZskiTvl/giB5Tf3TTWI21I/Nl0o6e2cDd8WMs=; h=Date:From:To:Subject; b=c3oCgPqMRhZp/v51VY+0DzR31fXi1tlgf3UgNoPOeTXGJfBpv9iJzZWEzbQu+c1IxQG9ZXKu YZMRZ3QhaSvbaGx6veNdtGGYXx14eXk1zpOcDUKDcDAu9RonK4zHsfCj00fsi9U38ypE8fxq1+ 3UkaGMwCjhMhvWoJHeWDKL8kshNvjtNFh3t2LvgH1r3WJxfae7NN1BzxpLjmBXkQIN5myWYe89 t5mu+4cjwZzkkN6ga480MTI5+6T8+ty+d+4+mn/xIZCSnukvpLIXnBlZjDh50jlbQ4RNuCdqu8 atnDlufIROP9TVkp0kHsqKGE8ZjKTCqN0ToyIEeT7Xh6QLUQ== Received-SPF: pass client-ip=175.135.255.2; envelope-from=kzhr@d1.dion.ne.jp; helo=mta-sp-e02.auone-net.jp X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --Multipart_Sun_Apr_13_20:08:20_2025-1 Content-Type: text/plain; charset=US-ASCII Following code returns unexpected result. (let ((inhibit-eol-conversion t)) (require 'rfc6068) (rfc6068-parse-mailto-url (concat "mailto:infobot@example.com?body=" "send%20current-issue%0D%0Asend%20index"))) -> (("To" . "infobot@example.com") ("Body" . "send current-issue^M send index")) Expected result is -> (("To" . "infobot@example.com") ("Body" . "send current-issue send index")) Furthermore, if URL contains "%0D%0A" and "%0A", though it is not compliant with RFC 6068, "%0D%0A" may be decoded CRLF, not LF. -- Kazuhiro Ito --Multipart_Sun_Apr_13_20:08:20_2025-1 Content-Type: text/plain; type=patch; name="0001-Fix-rfc6068-parse-mailto-url-with-inhibit-eol-conver.patch"; charset=US-ASCII Content-Disposition: attachment; filename="0001-Fix-rfc6068-parse-mailto-url-with-inhibit-eol-conver.patch" Content-Transfer-Encoding: 7bit >From a4905fa8a369a30f691866b4e68fa11ea9cbc9e4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Ito Date: Sun, 13 Apr 2025 20:00:44 +0900 Subject: [PATCH] Fix rfc6068-parse-mailto-url with inhibit-eol-conversion * lisp/mail/rfc6068.el (rfc6068-parse-mailto-url): Fix EOL type to CRLF and never inhibit EOL conversion in decoding. --- lisp/mail/rfc6068.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/mail/rfc6068.el b/lisp/mail/rfc6068.el index 8f0b4234410..cfa51196000 100644 --- a/lisp/mail/rfc6068.el +++ b/lisp/mail/rfc6068.el @@ -39,7 +39,8 @@ rfc6068-unhexify-string (buffer-string)))) (if inhibit-decode string - (decode-coding-string string 'utf-8)))) + (let (inhibit-eol-conversion) + (decode-coding-string string 'utf-8-dos))))) (defun rfc6068-parse-mailto-url (mailto-url) "Parse MAILTO-URL, and return an alist of header-name, header-value pairs. -- 2.45.1 --Multipart_Sun_Apr_13_20:08:20_2025-1-- ------------=_1745072642-2010-1--