From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.bugs Subject: bug#56824: 29.0.50; mail-header-parse-address drops the 1st character from the name Date: Fri, 29 Jul 2022 09:58:26 -0400 Message-ID: References: <87edy4kpm3.fsf@gnus.org> Reply-To: sds@gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31884"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: 56824@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 29 15:59:22 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 1oHQWP-00086r-SF for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 15:59:21 +0200 Original-Received: from localhost ([::1]:38756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHQWO-0007XG-IS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Jul 2022 09:59:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHQW7-0007Vf-81 for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43356) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHQW6-0007ny-WA for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oHQW6-0007FJ-Sy for bug-gnu-emacs@gnu.org; Fri, 29 Jul 2022 09:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sam Steingold Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Jul 2022 13:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56824 X-GNU-PR-Package: emacs Original-Received: via spool by 56824-submit@debbugs.gnu.org id=B56824.165910311927809 (code B ref 56824); Fri, 29 Jul 2022 13:59:02 +0000 Original-Received: (at 56824) by debbugs.gnu.org; 29 Jul 2022 13:58:39 +0000 Original-Received: from localhost ([127.0.0.1]:33104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHQVj-0007ET-86 for submit@debbugs.gnu.org; Fri, 29 Jul 2022 09:58:39 -0400 Original-Received: from mail-qt1-f175.google.com ([209.85.160.175]:46983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oHQVd-0007Du-Jj for 56824@debbugs.gnu.org; Fri, 29 Jul 2022 09:58:37 -0400 Original-Received: by mail-qt1-f175.google.com with SMTP id x11so3312643qts.13 for <56824@debbugs.gnu.org>; Fri, 29 Jul 2022 06:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:in-reply-to:references:user-agent :return-receipt-to:reply-to:date:message-id:mime-version :content-transfer-encoding; bh=7qruHoRNJifiiE3KEcIGoTbw5frPRpoi1CYXinZaO7Q=; b=OKpdLa9lydHeIsGH488rLIBF3jBeR91Uo00QxOnDddR9W3sFINPBBWvaGZ4vNg1/hY Oj0Hgh25UVP7ZBJyzKIZWWTP4IYtOtXrOU+mhrALONDUSON8alTnP8r2noeujQKTIUZK QAMkZyphG+IEa+VAMEP98GUo0VO6XZXJzcVYH0sjLnDXDfCYXnLlZmd1MFKVebzyTb9D chfzZxJLkCroNt9WSVrAyGRAatckKty9D34ypeWz4CAfvZb0N4ak5lqzd1tJm7faJaY4 LGC4UJIY6KSCR6RPQPrEy6rSqZp+zu3dHe3GL7jGu7PFNBAJsUVRYQe0z7cqP5kHGd48 lceQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :user-agent:return-receipt-to:reply-to:date:message-id:mime-version :content-transfer-encoding; bh=7qruHoRNJifiiE3KEcIGoTbw5frPRpoi1CYXinZaO7Q=; b=iUSHru7OcHZ9QiDUXOGLou/Wb32C+ddocB3gJ4mco0+5lWsXwudlto/TdATflTVV5u Cp6v1qdp3BBz1duVDuko/7NO8wL/Ps3Jrboxu/zMaolrGwA+Y80LxE/N241u7QqOqwEb ODdDlJNWvk24Bdgy8K1mhfHiZcmL4vtQChd0rc4RgG9xu8UERJ/8PF3kDJlL/TTsZXzz oZR5BTDhbkKE8vrxnrbCI2ebGRLz42h9OHVjMZmLejazzFl1Q5azxXTT0qKYtIg5gryv t5eCxT66BMcawnNEkkp26UgApsTl8FDPhU2EMfjppqiPiMrjNxtcZnl7V5TVOenIZlyV IpbQ== X-Gm-Message-State: AJIora+4I2M3aNDu7Q4G1nf0musqgZeeQt4zhRI8zbEEs6b4ujRu+yq/ Fsq2pwQCvvoeeCTXU1nVUg== X-Google-Smtp-Source: AGRyM1vdATpAfsgzfXsugkbX4OvOUqZ2NsppOb7IqMJkvHLhfhiNnaT3kiOF/SsGPWH16aGC+DsH8Q== X-Received: by 2002:ac8:5802:0:b0:31f:4cc2:639e with SMTP id g2-20020ac85802000000b0031f4cc2639emr3468059qtg.34.1659103107886; Fri, 29 Jul 2022 06:58:27 -0700 (PDT) Original-Received: from 3c22fb11fdab.ant.amazon.com (pool-108-30-23-113.nycmny.fios.verizon.net. [108.30.23.113]) by smtp.gmail.com with ESMTPSA id m7-20020a378a07000000b006b648d016f3sm2458807qkd.126.2022.07.29.06.58.27 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jul 2022 06:58:27 -0700 (PDT) In-Reply-To: <87edy4kpm3.fsf@gnus.org> (Lars Ingebrigtsen's message of "Fri, 29 Jul 2022 15:36:20 +0200") X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. 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:238178 Archived-At: > * Lars Ingebrigtsen [2022-07-29 15:36:20 +0200]: > > Sam Steingold writes: > >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D10406 >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D56422 >> >> Lars told me to use `mail-header-parse-address' instead of >> `mail-extract-address-components'. > > Well, not exactly. oops. sorry. ;-) >> Well, I tried, with a positive effect (thanks Lars!), >> but here is the 1st time the former is deficient: >> >> (mail-header-parse-addresses "=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec ") >> =3D=3D> (("stepnem@gmail.com" . "t=C4=9Bp=C3=A1n N=C4=9Bmec")) >> (mail-extract-address-components "=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec ") >> =3D=3D> ("=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec" "stepnem@gmail.com") > > `mail-header-parse-addresses' is for parsing RFC822bis mail addresses. > "=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec " is definitely not = one of those. Hmmm, it _used to be_ --8<---------------cut here---------------start------------->8--- "=3D?utf-8?B?xaB0xJtww6FuIE7Em21lYw=3D=3D?=3D " --8<---------------cut here---------------end--------------->8--- (is that what RFC822bis specifies?) but was passed through `mail-decode-encoded-word-string': --8<---------------cut here---------------start------------->8--- (mail-decode-encoded-word-string "=3D?utf-8?B?xaB0xJtww6FuIE7Em21lYw=3D=3D?= =3D ") =3D=3D> "=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec " --8<---------------cut here---------------end--------------->8--- and then passed on to `mail-header-parse-addresses'. What is TRT here? Should I call `mail-header-parse-addresses' _first_ and then `mail-decode-encoded-word-string'? Come to think of it, passing _email address_ through `mail-decode-encoded-word-string' seems unnecessary... --8<---------------cut here---------------start------------->8--- (mail-header-parse-addresses "=3D?utf-8?B?xaB0xJtww6FuIE7Em21lYw=3D=3D?=3D = ") =3D=3D> (("stepnem@gmail.com" . "=3D?utf-8?B?xaB0xJtww6FuIE7Em21lYw=3D=3D?= =3D")) (mail-decode-encoded-word-string "=3D?utf-8?B?xaB0xJtww6FuIE7Em21lYw=3D=3D?= =3D") =3D=3D> "=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec" --8<---------------cut here---------------end--------------->8--- > You're probably looking for `mail-header-parse-address-lax': > > (mail-header-parse-address-lax "=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec ") > -> ("stepnem@gmail.com" . "=C5=A0t=C4=9Bp=C3=A1n N=C4=9Bmec") ... Or maybe I should keep the current order of processing and use `mail-header-parse-address-lax'? Thank you for your speedy and enlightening reply! --=20 Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.2113 http://childpsy.net http://calmchildstories.com http://steingoldpsychology.= com http://think-israel.org https://thereligionofpeace.com https://iris.org.il In the race between idiot-proof software and idiots, the idiots are winning.