GNU logs - #75628, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Ingo Brunberg <ingo_brunberg@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 10:20:02 +0000
Resent-Message-ID: <handler.75628.B.17371091503432 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 75628 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.17371091503432
          (code B ref -1); Fri, 17 Jan 2025 10:20:02 +0000
Received: (at submit) by debbugs.gnu.org; 17 Jan 2025 10:19:10 +0000
Received: from localhost ([127.0.0.1]:36096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYjRT-0000tG-Te
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 05:19:08 -0500
Received: from lists.gnu.org ([2001:470:142::17]:58336)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ingo_brunberg@HIDDEN>)
 id 1tYjRQ-0000sk-P6
 for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 05:19:05 -0500
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 <ingo_brunberg@HIDDEN>)
 id 1tYjRK-0007P4-BO
 for bug-gnu-emacs@HIDDEN; Fri, 17 Jan 2025 05:18:58 -0500
Received: from mout.web.de ([212.227.15.3])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ingo_brunberg@HIDDEN>)
 id 1tYjRI-0002n8-Ix
 for bug-gnu-emacs@HIDDEN; Fri, 17 Jan 2025 05:18:58 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1737109132; x=1737713932; i=ingo_brunberg@HIDDEN;
 bh=oNzSKWNhSzudjvYbfuPsKiRAd26HfB5jDO/BfoC1cvk=;
 h=X-UI-Sender-Class:MIME-Version:Message-ID:From:To:Subject:
 Content-Type:Date:Content-Transfer-Encoding:cc:
 content-transfer-encoding:content-type:date:from:message-id:
 mime-version:reply-to:subject:to;
 b=VHGyPutGtnEboZOIWZ1CvIdidno25MrY6S+XjUP2ew/K9172Y5Lg5lkzNrHsLpQr
 D/OcwcJnCbms4ztdYFqf4K7W82UbBBg6w6I0WrMO1eu5X1z+1Bw2Lkq/XsT5/cuPd
 tlhHH6KppeybcObXrJLnsE+wbpnLNUR9hY+rXHL4S6sL3QMDYHWU/uULZsF8UHetl
 lKkc0KI8Cmlk+wltCCoJhp7SomVPG7ulG21i8jTa0Xvpg2s5NwfoRAKyo1Oe5CEwo
 Dl2INGoPi7j/7odiymu9cHTWR9/QQS00mjpC3/tFyVes4dkMNC1z94XOVUNiQw4fj
 sAmRFnRSshqwor8YyQ==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from [78.48.24.107] ([78.48.24.107]) by
 trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm (via HTTP); Fri, 17 Jan
 2025 10:18:52 +0000
MIME-Version: 1.0
Message-ID: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
From: Ingo Brunberg <ingo_brunberg@HIDDEN>
Content-Type: text/plain; charset=UTF-8
Date: Fri, 17 Jan 2025 10:18:52 +0000
X-UI-CLIENT-META-MAIL-DROP: W10=
X-Provags-ID: V03:K1:58g79uIqnaQANqATURWSahIWCpEyTYJEK6cyIOTU2HN6rstxGdkmTqpMrCrNpojy+m3t7
 N4ZJBjyze8NUiS/PApONtUL4OeLXYcrrxsyU4C2YL5284pLWA2FtoMwMF1Z4QJaGXz9i/0qJrsij
 1CwljUHjzuZTugd9e8CvOD7mNvP2XbccJ/mNPH0HttaLZKlsZciX0GFmLIaF923T7YZe0UxfaNco
 30q9weDL3SQnGGAcTbiO5WDJ2ktB/FfbzQ7+ogpQqjZifDZ28MBGvGgH7eFrAJcePA6QfdjTqJ93
 5YrBUatP/Gzuc69YcRH7W8sbyvQ/1x/YyhnYBk52D/dt0xVqTA8OEW+eMtXGQaoiHWO/Z0QvR06i
 d5X1J+2dwYj
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:Fp1TjjEdRck=;kXqcbhoFzzXgdVPIxk17p5ll0cK
 47aOQMq0iPum3ah5QruTXgKi6Os8YbufMr9pTeRBXjpcF4MlmMvzpz2XugtcOUbIjBsUcV4Fi
 OZuIz8zH3ysCHjLNsWXFUJIphQL/rhuvXwSjuk7AVz/uvLcrh5xuxiO0b5vqCqTHnnAu5lcJC
 eyucT+CN7huhEiqdh54i5rUiU4gu64Wh+UB6A42/r9LOrYwY2WOWesmXyLeUHFF3DQwX72MRa
 PbLVuOGBvT6M3eOTg1BdIsSPytNTZLn3G9zuPJQi9ghFj6FP2vsaW2n4H0IikIYhsMNjtG1tz
 YQ/5mlTZN6Y83gZzdHVYcl+YkU1bM3dHHxSF5IKWfppFJiDASPjxvNkqwW8BdDmG7RKhIWNaW
 6JPg56kjdi4/zwpZ6HqPnpLrAQaD5onsxKdJL+lvMb0yfFubxdiC9TUM/dKEXauGx4zs8akAH
 Q1gYL+aYAsCCET78XezLkfZvNWLhrwxB0yZR6T5ATV9dIsVT66otIWLFcDyN8IYHV7z9wzU2i
 8wwlapT2S1RtK1v0oMUfe4Iwv7uKe2gBcSL5egR0+vRb5mW4ToLUdmySaroH8TPQvOK5dt08o
 aujzJbbxgELvOy6y1SKnyAhNvTfv3wzWrGWDdlQSPt2lncbxRiumcghs8Vx3NqjrZsw9Vqbw3
 35wjIc/ABfeIbcchD8uEbLba4IwMz3xcsJe1NFZWhEs1h5zv4oZIDQj+aSxaGW2ePfsCRr5zN
 lB3SO6L8lWd3CamnikopGdcMWs99NXUceQpZXUZ8auCzX2xBz88O/BwQ2P98JNKibthykBVtj
 1r7TYkC5md90KpswayMd6KeDv1I39OtfXNro3gO0x4/Hhrnb5zGP4tBRrTCesTpj1FyNa28CM
 fILeXHRQoYbhjhkawIxJ/TTQBb3U9AH8lN2+bZE5YsUQjLsHPbdzZIDdfSBRbWeRL+36UkfIX
 6L6HA4hfcyPoLzS2uuZBAmQV0kasMQOhDdfX8teYjTgQFyIC
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=212.227.15.3; envelope-from=ingo_brunberg@HIDDEN;
 helo=mout.web.de
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

When I try to send mail with emacs using SMTP, I get error "Multibyte char=
acter
in data for base64 encoding".

In the current code I have narrowed it down to line 637 in smtpmail.el, wh=
ere an
attempt is made to base64 encode a string containing the password which, o=
f
course, can contain multibyte characters.

With a simple password some time ago, I could send mail.





Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: Ingo Brunberg <ingo_brunberg@HIDDEN>
Subject: bug#75628: Acknowledgement (31.0.50; Error sending mail using
 SMTP - base64 encoding fails)
Message-ID: <handler.75628.B.17371091503432.ack <at> debbugs.gnu.org>
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
X-Gnu-PR-Message: ack 75628
X-Gnu-PR-Package: emacs
Reply-To: 75628 <at> debbugs.gnu.org
Date: Fri, 17 Jan 2025 10:20:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 75628 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
75628: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D75628
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 12:57:01 +0000
Resent-Message-ID: <handler.75628.B75628.173711857212684 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Ingo Brunberg <ingo_brunberg@HIDDEN>
Cc: 75628 <at> debbugs.gnu.org
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173711857212684
          (code B ref 75628); Fri, 17 Jan 2025 12:57:01 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 12:56:12 +0000
Received: from localhost ([127.0.0.1]:36317 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYltT-0003IU-PR
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 07:56:12 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:35140)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tYltR-0003Hv-4f
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 07:56:10 -0500
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 <eliz@HIDDEN>)
 id 1tYltK-000271-KC; Fri, 17 Jan 2025 07:56:02 -0500
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=SzR2GY13zv4OV7m1D5zM9vuCObmhSF8FuIsn4fv8AKs=; b=AXz/Jly0T+B3
 fhDE2TP3defcE2xQTnDid/AcJeXCyc2IDZhwrZvgo9mKglZssYcvPlDQ7AVKO8oNw2EscACBAyIsu
 LTNzKWpu1esLq5u6WeVPy8TGxg+PFDKonaeeS6kVn/GNhwXo9bxKcq9ZMDMOt14qHHtJ5SDYE0oal
 bN6U+MG98eo/b+Yd3Vbzwvscjns0vdqxbSgpzVkQImVbk+VK0WV3kyskOIjU9J3v+hcrb0kM2snri
 Dz1GPHcOY6PuC/Pt9cwKvPGcre8ymu/iR9l+AGCsLtR1LI+U5VTDgpKfw4xoqXt/JXKZCY8UQJhJ4
 ryIdTb3NbZ4IBrX4yGlDVQ==;
Date: Fri, 17 Jan 2025 14:55:55 +0200
Message-Id: <86zfjpeh0k.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
 (bug-gnu-emacs@HIDDEN)
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Fri, 17 Jan 2025 10:18:52 +0000
> From:  Ingo Brunberg via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> When I try to send mail with emacs using SMTP, I get error "Multibyte character
> in data for base64 encoding".
> 
> In the current code I have narrowed it down to line 637 in smtpmail.el, where an
> attempt is made to base64 encode a string containing the password which, of
> course, can contain multibyte characters.
> 
> With a simple password some time ago, I could send mail.

Thanks, but please show a complete recipe, preferably starting from
"emacs -Q".

base64 encoding indeed requires its input to be a unibyte string, but
it is impossible to guess how this failed to happen without seeing the
sequence of commands you typed to trigger the problem.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Robert Pluim <rpluim@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 13:16:01 +0000
Resent-Message-ID: <handler.75628.B75628.173711973716631 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: 75628 <at> debbugs.gnu.org
Cc: Ingo Brunberg <ingo_brunberg@HIDDEN>
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173711973716631
          (code B ref 75628); Fri, 17 Jan 2025 13:16:01 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 13:15:37 +0000
Received: from localhost ([127.0.0.1]:36374 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYmCG-0004K8-IX
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 08:15:37 -0500
Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:54645)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1tYmCE-0004IS-Bf
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 08:15:35 -0500
Received: by mail-wr1-x431.google.com with SMTP id
 ffacd0b85a97d-3863494591bso1097320f8f.1
 for <75628 <at> debbugs.gnu.org>; Fri, 17 Jan 2025 05:15:34 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737119728; x=1737724528; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=Jwaht2DD6eq7draQDqX8xYTwkPsivslb3/9oF0QEgHk=;
 b=Z0Uh4BOg5uTPdOEI90BOuj2lif69/RVmuAdF6ZrjoAERnU7VyQBNtqqdyvqni+eLoE
 5c8LaTPKrUM6XNwsU/aUtZ5iu+7uOesgrJJ0CaevN01m6IWz1DkveoBIIb+pAxeWhEnP
 UBByvGiPOrldCp6HjieMM43K6Yd01IBjro1iLtiUDc72YH/cegwFtEZ6FIyAAZMzybPo
 HF/C4mv9NEbkrgk4X5xxq1w7KoBPcU3Dm3dV+utetvtuARZ7LlFvahehM51rFqhYO4us
 E3qjeBRHavUERNj5Qg73nvJWgPNoDFlbpPmVcayBwTbEGh8o6UZiopNUgei+Ifpa488r
 IrKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737119728; x=1737724528;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=Jwaht2DD6eq7draQDqX8xYTwkPsivslb3/9oF0QEgHk=;
 b=cH2AUQoho2kf8RjvRqqy+NOpBAZZonJKpx3x/7t6Rs+T/Qd1R0gAPefOBj82YQlRdE
 ELkzYnTQLvMEGKNpBK50EBvjOB7MHGiq9sDgomDDUq8+wF4f1AkzwC/SwJGRY6VP8Wz5
 WGPi6PWpnx7O+XrYh58qdwoM16QFbCbaq7oI8bszACBJLFwB8RrOsdWk2w7Zy1pBI6ib
 /dqrp/fw65YRczgXY8OTNTlDl22qFVV825Jbxx8Bjn6OftupVGytxB5iSefs1qhYX9pg
 C6rFiEwehp6P5tzTumVfPfXOXPNkSgilTYfOVNGy6fBkfLxdtmqmM+hx1aqY6kYHM1/l
 CPhA==
X-Gm-Message-State: AOJu0YxtmB2iDQ8laSvyxzd/dG3NSVfOJLN2gvOlLV+LQ0pICPjiSOHz
 LlJNVLKt65JC2ywV2eyDWnwdncS+xKKXeIpHYopo7I26oKcBJkBA
X-Gm-Gg: ASbGncspUCvKzqB4IPC5qlruvI0D8/d9QihwbClAYSQRZNCFFWaVCCEXhwBtf8jaFhD
 d3nxXtbg11oMumwu/bpQZIVX0i7CUrTxsp/6hY+cD0zVgZXENqAy9e23BYtykeHQacKkp/6Bo3X
 tvl4QHXl7jatCqn1ZNV+nSIdfSwfhB/5i7jLY4AqgJbiC1l4ZSMou9x6yc3ZnEidY1F58WnFX/e
 bADSFmSkbEyJkI0hnakZS4GaozW0yOQb5n4GHmESrk=
X-Google-Smtp-Source: AGHT+IHU0SbQLllP1s8W5gB6mMlsZuDY4YZpK1w5RLbdLkqTrOtCSdTxtko4p6B/PrwM3ms77oLhDQ==
X-Received: by 2002:a5d:5848:0:b0:38b:dbf0:34f2 with SMTP id
 ffacd0b85a97d-38bf59f03c7mr2452100f8f.52.1737119727747; 
 Fri, 17 Jan 2025 05:15:27 -0800 (PST)
Received: from rltb ([2a01:e0a:3f3:fb51:a8e5:fe72:1cb:767b])
 by smtp.gmail.com with ESMTPSA id
 ffacd0b85a97d-38bf3221db2sm2452777f8f.29.2025.01.17.05.15.27
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 17 Jan 2025 05:15:27 -0800 (PST)
From: Robert Pluim <rpluim@HIDDEN>
In-Reply-To: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
 (Ingo Brunberg via's message of "Fri, 17 Jan 2025 10:18:52 +0000")
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
Date: Fri, 17 Jan 2025 14:15:26 +0100
Message-ID: <87jzateg41.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Fri, 17 Jan 2025 10:18:52 +0000, Ingo Brunberg via "Bug reports fo=
r GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN> =
said:

    Ingo> When I try to send mail with emacs using SMTP, I get error "Multi=
byte character
    Ingo> in data for base64 encoding".

    Ingo> In the current code I have narrowed it down to line 637 in smtpma=
il.el, where an
    Ingo> attempt is made to base64 encode a string containing the password=
 which, of
    Ingo> course, can contain multibyte characters.

    Ingo> With a simple password some time ago, I could send mail.

Does this fix it? I guess at least "AUTH LOGIN" needs similar
treatment, and probably "AUTH CRAM-MD5". I don=CA=BCt think XOAUTH2 needs
it, but I=CA=BCll check.

diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 6cb576fe72b..5aebbec14d0 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -631,11 +631,12 @@ smtpmail-try-auth-method
   ;; violate a SHOULD in RFC 2222 paragraph 5.1.  Note that this
   ;; is not sent if the server did not advertise AUTH PLAIN in
   ;; the EHLO response.  See RFC 2554 for more info.
+  (let ((password (encode-coding-string password 'utf-8)))
   (smtpmail-command-or-throw
    process
    (concat "AUTH PLAIN "
 	   (base64-encode-string (concat "\0" user "\0" password) t))
-   235))
+   235)))
=20
 (cl-defmethod smtpmail-try-auth-method
   (process (_mech (eql 'xoauth2)) user password)






Robert
--=20




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Robert Pluim <rpluim@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 13:28:02 +0000
Resent-Message-ID: <handler.75628.B75628.173712042318748 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: Ingo Brunberg <ingo_brunberg@HIDDEN>, 75628 <at> debbugs.gnu.org
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173712042318748
          (code B ref 75628); Fri, 17 Jan 2025 13:28:02 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 13:27:03 +0000
Received: from localhost ([127.0.0.1]:36395 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYmNL-0004sI-1j
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 08:27:03 -0500
Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:54500)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1tYmNJ-0004rY-63
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 08:27:02 -0500
Received: by mail-wm1-x32f.google.com with SMTP id
 5b1f17b1804b1-436326dcb1cso13859945e9.0
 for <75628 <at> debbugs.gnu.org>; Fri, 17 Jan 2025 05:27:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737120415; x=1737725215; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=0pnPOjhw8XT+f3FkVWVzWs3Wt+vYKjkmwLff0S4Gj5o=;
 b=KWIKjPhYM3jMpleuJ32vRNhfmy/cSVgxtAkhItHkgwRhzaSgrrAvF0KY5Pcqmb5/zg
 AigL6m8bBVdKMeKFw/O1oybzXwPWMC37wNEBxl3w410GeqrLUGgNOIOjypnWmI65bCGC
 h9h1GTUjNslB5mOwhWO6JbP+hqgcGYM+v/9r+SNsiWw3BVejYUi7Cl53bZ6NEnyfnN1y
 XaFHCxxp8NBn42sdiN4VBVP66PXFBmBcNNJG9HPcKLyiERZ3PHSt+jVrPUy8NOhdYz92
 lUhHYFj///18DTeX1xSChy+qNKarJWnxOsmlChaPjqH7soPLt7jawT0HUGUbPddB59E/
 uZSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737120415; x=1737725215;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=0pnPOjhw8XT+f3FkVWVzWs3Wt+vYKjkmwLff0S4Gj5o=;
 b=FtoViRjDJI4fVhHC8gdcwOSv3bcSFtL5aqGzp/V/TSSpvOyaGQzb3el7f7ftnLRWG2
 YuaQNfb3MDuJ0yif+G82Gugcno2b+aaBK3aTmv7w2oh9YuZ7wKHeaEL+aJxkL+B0RJdP
 xiYmtfKZkjvP9VUn2oOAmq3Mw/jUiekqYtnp2uH3p8UNhxUPMmOxRZkKakxyezZH85dL
 F7KhaC8z8KYJeI8Lk/9IOXsIxghozQSE0yGRbaoRcNoXC9QHhiXgyhCSYIWDxteFSVsO
 1K907CuOr6KWMVmYh/yZ/N/dXfQ5ecMnsNUzr7GSIaBTuN2KkrZBPCD/eSDGpqDmJwNi
 EtrA==
X-Forwarded-Encrypted: i=1;
 AJvYcCUv7qKO8gB0klEVj5rSPATCay5TCSgQJGaHG2/QhU6/B2wd7vuhQJQ4XVYC2/YdKLNdhiYDWw==@debbugs.gnu.org
X-Gm-Message-State: AOJu0Yzy3AmuqwiC6oOa/lULA4phREjwVgHKP/KozjVeaBOKYSM9KUVx
 drmGcwocc/Zt534dLiEOrIyLtx+KR/23rN04TGTr0CzWCQt9KwXJ6XL2Og==
X-Gm-Gg: ASbGnctDuZ48eyq5D1tbBKx/Kcddv8WJdrHsYfEmjCUotH6/PUjk9nLqzxvtzqvACSq
 1sn5x48XeOTfb6Ozhgu/q/rHfu4RxN3RXVMZG+p/uaNXE7nd6qKKUp/N9s/nj/MhIQvHxY7UmOC
 boCNSO22dJQ+0RIXM4wlMj6Tz47nHccfCc+RybM/YYMo4xdt/fSU+Azkf4LYs0D28p0Sk63oQjo
 ytGHjURp6vXC+zIxszBMImKYDmXeXO5dYu53fUU6R0=
X-Google-Smtp-Source: AGHT+IHS/k+us8+S0zCnO4KfRANd1eOddAwtrgQuvEUqCtxINkYQMiNUxaHIA9rv9aMnBSs3LPlgYw==
X-Received: by 2002:a05:600c:1f10:b0:434:ff9d:a370 with SMTP id
 5b1f17b1804b1-438912d1d49mr29570235e9.0.1737120414443; 
 Fri, 17 Jan 2025 05:26:54 -0800 (PST)
Received: from rltb ([2a01:e0a:3f3:fb51:a8e5:fe72:1cb:767b])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-438904131easm32992185e9.12.2025.01.17.05.26.53
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 17 Jan 2025 05:26:54 -0800 (PST)
From: Robert Pluim <rpluim@HIDDEN>
In-Reply-To: <86zfjpeh0k.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 17 Jan
 2025 14:55:55 +0200")
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
 <86zfjpeh0k.fsf@HIDDEN>
Date: Fri, 17 Jan 2025 14:26:53 +0100
Message-ID: <87frlhefky.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Fri, 17 Jan 2025 14:55:55 +0200, Eli Zaretskii <eliz@HIDDEN> said:

    >> Date: Fri, 17 Jan 2025 10:18:52 +0000
    >> From:  Ingo Brunberg via "Bug reports for GNU Emacs,
    >> the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
    >>=20
    >> When I try to send mail with emacs using SMTP, I get error "Multibyt=
e character
    >> in data for base64 encoding".
    >>=20
    >> In the current code I have narrowed it down to line 637 in smtpmail.=
el, where an
    >> attempt is made to base64 encode a string containing the password wh=
ich, of
    >> course, can contain multibyte characters.
    >>=20
    >> With a simple password some time ago, I could send mail.

    Eli> Thanks, but please show a complete recipe, preferably starting from
    Eli> "emacs -Q".

    Eli> base64 encoding indeed requires its input to be a unibyte string, =
but
    Eli> it is impossible to guess how this failed to happen without seeing=
 the
    Eli> sequence of commands you typed to trigger the problem.

If the password is coming from 'auth-source', it will be a multibyte
string:

ELISP> (auth-info-password (car (auth-source-search :host "test")))
"b=C3=A4r"

ELISP> (multibyte-string-p (auth-info-password (car (auth-source-search :ho=
st "test"))))
t

Robert
--=20




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 13:38:01 +0000
Resent-Message-ID: <handler.75628.B75628.173712103920758 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Robert Pluim <rpluim@HIDDEN>
Cc: ingo_brunberg@HIDDEN, 75628 <at> debbugs.gnu.org
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173712103920758
          (code B ref 75628); Fri, 17 Jan 2025 13:38:01 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 13:37:19 +0000
Received: from localhost ([127.0.0.1]:36412 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYmXG-0005Oi-LK
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 08:37:19 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:51476)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tYmXB-0005OG-TY
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 08:37:17 -0500
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 <eliz@HIDDEN>)
 id 1tYmX6-0001Co-6M; Fri, 17 Jan 2025 08:37:08 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=mlOAfd05xWz9IyLxJ6AxEq2uJQR8EmdONPLbOupyoFo=; b=PweKSZSrRGXgELX1pVBQ
 p7zuoCIEudyI/UGvooOhEKrriXVeSsNCwryydBfgK1XEpsRowyhAu0Mcjml9DrpAO5r9XqzPYiqZH
 O9BeZdgx23HSPztlGTg6kkzphEDHJKcurzsg1aFNaFKERk0DYtCxg6dYejy6dbNdNIf3hRtihms6l
 K2JqUiBAS1vgxOtJyO7wJ8b6EXHVop611wOxqyX1rO0nvT79PfJI8x3t5whTgTIvHRMm0j0gpOyzY
 W0Skgk92yKR49IN0x39Itm90dYBvltYHLAcqA/0LUUObFUUvby8RQ7GW1pFpyF6mhW1x9nag9T89B
 elRMXkDpiDApvA==;
Date: Fri, 17 Jan 2025 15:36:59 +0200
Message-Id: <86ikqdef44.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87jzateg41.fsf@HIDDEN> (message from Robert Pluim on Fri, 17
 Jan 2025 14:15:26 +0100)
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
 <87jzateg41.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: Ingo Brunberg <ingo_brunberg@HIDDEN>
> From: Robert Pluim <rpluim@HIDDEN>
> Date: Fri, 17 Jan 2025 14:15:26 +0100
> 
>     Ingo> With a simple password some time ago, I could send mail.
> 
> Does this fix it? I guess at least "AUTH LOGIN" needs similar
> treatment, and probably "AUTH CRAM-MD5". I donʼt think XOAUTH2 needs
> it, but Iʼll check.

If this is the fix, then how do you explain what the OP says, that
"some time ago" he could do this without problems?  Do you assume that
the "simple password" was plain-ASCII or something?

The OP didn't show the data collected by report-emacs-bug, so we don't
know the locale's encoding in his case.  That could perhaps explain
the difference in behavior.

Also, smtpmail-command-or-throw calls process-send-string, which
should already encode the command.  So the call to
encode-coding-string is almost certainly incorrect; if anything, we
should bind coding-system-for-write to 'utf-8'.  (Btw, how do we know
UTF-8 is the right encoding in this case? is that in some relevant
RFC?)

Thanks.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Robert Pluim <rpluim@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 14:01:01 +0000
Resent-Message-ID: <handler.75628.B75628.173712241124701 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: ingo_brunberg@HIDDEN, 75628 <at> debbugs.gnu.org
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173712241124701
          (code B ref 75628); Fri, 17 Jan 2025 14:01:01 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 14:00:11 +0000
Received: from localhost ([127.0.0.1]:36466 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYmtO-0006QK-Ka
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 09:00:11 -0500
Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:53420)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1tYmtK-0006PB-Iz
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 09:00:08 -0500
Received: by mail-wm1-x333.google.com with SMTP id
 5b1f17b1804b1-43624b2d453so22355115e9.2
 for <75628 <at> debbugs.gnu.org>; Fri, 17 Jan 2025 06:00:06 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737122400; x=1737727200; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=xkbt386tX9PNtd6O8QkCfack0b2RXUt5aMtSMe955m4=;
 b=LinlAjI/Vl29I+g+SpanOBTkf21p5VBLLU50p+23Y7KlAhNmYvMjVTT1g8Y5AMMbOf
 3XilD4Pc0wWdXAGRnvhYwjw2Phr/vbCAqWB7R4YQt8ivgPJbiw6eRZt2v8gl6Gmqxbxm
 ZklshXMRXn9Xtur+MasXshrexXADYCNbqILf/GA8SmNqKC0oGKxmISYfpTIXBYkEyTe/
 MG2mZiysyKNZ9kNbV2HiuJGNB5cKDqbgUHYCdfmgOGnBDNMJ74HLs9CiTZhEEuG5oY0g
 rme8DcIDExdklnvGUtcKGey66krlV1b6G1SB0Avra/Kjmxc0sNCk3WQEhZjOUcYOxXy5
 rbEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737122400; x=1737727200;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=xkbt386tX9PNtd6O8QkCfack0b2RXUt5aMtSMe955m4=;
 b=Y3cs5MaHW2gTHNNW8Ejnujlkkp3bHZdb10dhGRYq5AOl4XNEZpWduySU3yizf/alEz
 lMOLFzW6qzfLKKvCK2Ozl54pxZvqQJzeSIHwPtE30JUPG5bM0LS8bzh29M1C1IfDbQW9
 kpgSLwBMbNouJXaKDmnyhr7vqkysfUvX19+oKBl4sLYDjZLFlVtQhlFSMNemxyKEcvqQ
 mQBo3sVSvQuvk3lBLK/qLUlXimez8BJBNcOUhIIUW27dZIYGn8WUntL24L52ThPeDm5z
 eH50l2N96iHbcosr48Y9qtIdn1NXYRtwHcWlsu7j6tJu1EOkCvJwuDKLyE8Ydz/GZFBg
 h/4Q==
X-Gm-Message-State: AOJu0YzC5hbF4Na17npF1/2Bgx3eRNZJ3ohNnT/juQhwwNGJX/71PV+N
 7SODmJwiLoVOQvhHrjBWR3HDVarFBTuR7rGhO3znPBEdKi7/xgml
X-Gm-Gg: ASbGncuIkmktcxGIqyFmCNxhtHZr8Qu1r5oBm8qDjMwsskt1nxQzbqtpZV/Y2pInmIw
 RyacyUGtec6PimwTqq7yUJIex051gm1Ha4IiZM7byJIcxYtpfLSO/U02FVoCElD0VO/f3Ik0duS
 6pRHMjB7TX4DIdGyvRy4H/WrlbBrP/dT+leDMglnF581DeMvaM1a3zpsS1I4GoBn90IwL/nrBaM
 bBd8o/5MznLQSNkiekePzMYoFgug60Zw47OOZCKusE=
X-Google-Smtp-Source: AGHT+IGZ2dWOJVG75B2HYPQsS2Q3niKttNbk8fpyU96doBVz1ZMBAefw7YyHzRD2ig3gxkhYSM3C+A==
X-Received: by 2002:a05:600c:3c82:b0:434:f5c0:329f with SMTP id
 5b1f17b1804b1-438913f08a2mr33051505e9.14.1737122400090; 
 Fri, 17 Jan 2025 06:00:00 -0800 (PST)
Received: from rltb ([2a01:e0a:3f3:fb51:a8e5:fe72:1cb:767b])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-437c7499932sm94489325e9.7.2025.01.17.05.59.59
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 17 Jan 2025 05:59:59 -0800 (PST)
From: Robert Pluim <rpluim@HIDDEN>
In-Reply-To: <86ikqdef44.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 17 Jan
 2025 15:36:59 +0200")
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
 <87jzateg41.fsf@HIDDEN> <86ikqdef44.fsf@HIDDEN>
Date: Fri, 17 Jan 2025 14:59:59 +0100
Message-ID: <87bjw5ee1s.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Fri, 17 Jan 2025 15:36:59 +0200, Eli Zaretskii <eliz@HIDDEN> said:

    >> Cc: Ingo Brunberg <ingo_brunberg@HIDDEN>
    >> From: Robert Pluim <rpluim@HIDDEN>
    >> Date: Fri, 17 Jan 2025 14:15:26 +0100
    >>=20
    Ingo> With a simple password some time ago, I could send mail.
    >>=20
    >> Does this fix it? I guess at least "AUTH LOGIN" needs similar
    >> treatment, and probably "AUTH CRAM-MD5". I don=CA=BCt think XOAUTH2 =
needs
    >> it, but I=CA=BCll check.

    Eli> If this is the fix, then how do you explain what the OP says, that
    Eli> "some time ago" he could do this without problems?  Do you assume =
that
    Eli> the "simple password" was plain-ASCII or something?

Yes

    Eli> The OP didn't show the data collected by report-emacs-bug, so we d=
on't
    Eli> know the locale's encoding in his case.  That could perhaps explain
    Eli> the difference in behavior.

    Eli> Also, smtpmail-command-or-throw calls process-send-string, which
    Eli> should already encode the command.  So the call to
    Eli> encode-coding-string is almost certainly incorrect; if anything, we
    Eli> should bind coding-system-for-write to 'utf-8'.  (Btw, how do we k=
now
    Eli> UTF-8 is the right encoding in this case? is that in some relevant
    Eli> RFC?)

The encoding done by process-send-string is done after the base64
encoding of the password used by the "AUTH PLAIN" command, so it
doesn=CA=BCt help.

RFC 4616 specifies that the arguments to "AUTH PLAIN" are in UTF-8
(prior to encoding with base64, see RFC 4954), so we should be
encoding 'user' as well, strictly speaking.

Robert
--=20




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
Resent-From: Ingo Brunberg <ingo_brunberg@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 15:52:01 +0000
Resent-Message-ID: <handler.75628.B75628.173712909116179 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Robert Pluim <rpluim@HIDDEN>
Cc: 75628 <at> debbugs.gnu.org
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173712909116179
          (code B ref 75628); Fri, 17 Jan 2025 15:52:01 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 15:51:31 +0000
Received: from localhost ([127.0.0.1]:38588 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYod8-0004Ct-Mf
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 10:51:31 -0500
Received: from mout.web.de ([212.227.15.14]:41613)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <ingo_brunberg@HIDDEN>)
 id 1tYod5-0004CV-5o
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 10:51:28 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1737129078; x=1737733878; i=ingo_brunberg@HIDDEN;
 bh=SzfqPngqO67ifj3SLGCgiB7CmVwxlLqWlFRAuxZQ6MI=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:Date:Message-ID:
 MIME-Version:Content-Type:Content-Transfer-Encoding:cc:
 content-transfer-encoding:content-type:date:from:message-id:
 mime-version:reply-to:subject:to;
 b=A49BhMl9pzqJ+j+1g362IBb7xFRGCI8tpnnvFhxSud01ypbCwyTAUPrbfHXp35NM
 wljej7Q0lPJr/+7vUY7CmvdmceNaK4LtZfXDrXuOMuWeBu7204EeMLsIHA5w1Vt08
 cHD736lPTx839CUstLAA1uHqlu8VH/Kupn9Em7+6AH6dXe6CIPd+23pJAypkqkyqN
 9xGOD5hjIhe+urz+tK04pz3MZGP0Qhrf6hrnh44qfnvstppvXtl7ILtkcoqxd2G5N
 TCOB9glyOtJMGpUNZm3gjTwLmjiA2z0vzG2VUki68dEmXh6nCTV59X0RUGJIxLPk1
 yRtdEeVzRdKSVExtvA==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from ingo ([78.48.24.107]) by smtp.web.de (mrweb005
 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MbCE0-1sxY0E2S0e-00fqFM; Fri, 17
 Jan 2025 16:51:18 +0100
From: Ingo Brunberg <ingo_brunberg@HIDDEN>
In-Reply-To: <87jzateg41.fsf@HIDDEN> (message from Robert Pluim on Fri,
 17 Jan 2025 14:15:26 +0100)
Date: Fri, 17 Jan 2025 16:51:15 +0100
Message-ID: <m3sephv3po.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Provags-ID: V03:K1:K8JDSS3adOndihrCJJgsFl/jT9+gyeRN1ZzuDnDn/1TaECGeETr
 J43t31tLxHTbPnfM/raRVyOEk/a8r7TqZZPD38wJwkoj1ODYuyLnZkWjUm0rjNOJ5ShrZ6L
 cnJU3D35VcdPyHX7HicuYF6esIpVY0f6jgofmNuIysghktw9f4IZAdrdvv7f5G2uLI3Iueo
 zR9cqBe/mBz15ld4HfwFw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:u2Ol38jst+U=;Qaeh2q/9ZryKn87mllYzDTY9JTZ
 I1KflYzj+Q9OL28BtjSms9IRYfs6lQvVtdG61P7/khw2Hua/MFjdQ7l1LVRgLnSaIzLbLFG+u
 lJKl3KYbeO+BDl5cZDl9mISoQmIGvFVO/3O6Ai5hvUfmTn9VOtjRiqkG6Odx+rAGDJNQgkFof
 oIq+FtyJ4W0GOQ2/ozkA6rVHlhbqlRvyAZIr3GNNgo5KWUgBWGqpHHpe9ctI+EVfPmoxLG369
 rFDRnHblqitXg6haF0k7LoRFUMPKWJ+lXPnhDCdc6Ois0CwzNQxTqcfWbp9iGc2+s3iTqb9e3
 odyT5+4BPgdm9/3ecvI3Vnqqnuc9Jpvdt7rSuv7for/htBBPv9YA/P7ZujyWjumCSA5F+2z6l
 EVXvI7kNfvfhdvDWcpUt0UVfnMT0D8r0myGuyc+0vALlTj83bvAjxHY6e71NVXSJDyvefMF8z
 c8ogq4XSn9+nTT5zwVEZsAb0QhOxLKLRk9ACOvs9Ua7a/2l46dAemgSkH3IAeZ79cDPjFPbpm
 cSnAzrepU5sDs5FCLZFUMNwPOQyemwIxJwo6HKSxPrYJdYk9BKYdXvEOlF0ti1wJZoYyVimXE
 4nsr2nqwbm3hqPGCWyUOUm9nl/p2CRIaqpxbNL0G9pIoKAr8V4ZtiLBJZ9h1POJPAVNFNTzo1
 YvyPH9penOnHL9GImPXeT/q/CoXeLDsUYGQBJvOYF/dxxMzo4kuCl2m97UmxmAHRvEnbYrXe1
 mm0/vmAqpPRTibg5O7ODPrJTBLeV7zQ01mD4ld281uRBh0rX6BDOdujKrtb0qWtTZiTX0MZUK
 Qxm/eUDwbsvGfXBVshIqP811m63/FPZYfKaDHOpPWxuCDwxnOOm2v7L/lrXJLYW/+jVHKedxF
 +y4jlUvjSWQyo84iIDCblodKBy9eTpEGQc6ixYHAynB8xqW/Q0n68dGvFj11JU76h9zGC+sVF
 Ymq2aNZJKZsg5HCp9OnBpanNdoXzpEbqRBR2ARKoSIjidf8oHx6R6pLRDWheM368b4i2Tvc4L
 vUyErltrxgaaoXvjmg1XSbBW6uWvvVZCcOm0X6flz7Ydr654LheIYhACoCwXo0QyHXw04lQiz
 8t8VxgCZD/glPM3QLicn8viQi+qCrxTt2sDyicMmJ7gQ8sYd/JpFbo/+6z+HJA7U9+7jv/rWk
 rrjzAkrOWsjd3rOUbrJMc
X-Spam-Score: -0.7 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hello Robert,

yes, your patch does indeed fix the issue. I also guess there are more
places which need that treatment. Glad, it works for me again.

Thanks
Ingo

Robert Pluim <rpluim@HIDDEN> writes:

>>>>>> On Fri, 17 Jan 2025 10:18:52 +0000, Ingo Brunberg via "Bug reports f=
or GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>=
 said:
>
>     Ingo> When I try to send mail with emacs using SMTP, I get error "Mul=
tibyte character
>     Ingo> in data for base64 encoding".
>
>     Ingo> In the current code I have narrowed it down to line 637 in smtp=
mail.el, where an
>     Ingo> attempt is made to base64 encode a string containing the passwo=
rd which, of
>     Ingo> course, can contain multibyte characters.
>
>     Ingo> With a simple password some time ago, I could send mail.
>
> Does this fix it? I guess at least "AUTH LOGIN" needs similar
> treatment, and probably "AUTH CRAM-MD5". I don=CA=BCt think XOAUTH2 needs
> it, but I=CA=BCll check.
>
> diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
> index 6cb576fe72b..5aebbec14d0 100644
> --- a/lisp/mail/smtpmail.el
> +++ b/lisp/mail/smtpmail.el
> @@ -631,11 +631,12 @@ smtpmail-try-auth-method
>    ;; violate a SHOULD in RFC 2222 paragraph 5.1.  Note that this
>    ;; is not sent if the server did not advertise AUTH PLAIN in
>    ;; the EHLO response.  See RFC 2554 for more info.
> +  (let ((password (encode-coding-string password 'utf-8)))
>    (smtpmail-command-or-throw
>     process
>     (concat "AUTH PLAIN "
>  	   (base64-encode-string (concat "\0" user "\0" password) t))
> -   235))
> +   235)))
>=20=20
>  (cl-defmethod smtpmail-try-auth-method
>    (process (_mech (eql 'xoauth2)) user password)
>
>
>
>
>
>
> Robert




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Eli Zaretskii <eliz@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 16:45:02 +0000
Resent-Message-ID: <handler.75628.B75628.173713226926062 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Robert Pluim <rpluim@HIDDEN>
Cc: ingo_brunberg@HIDDEN, 75628 <at> debbugs.gnu.org
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173713226926062
          (code B ref 75628); Fri, 17 Jan 2025 16:45:02 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 16:44:29 +0000
Received: from localhost ([127.0.0.1]:38653 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYpSP-0006mI-3Y
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 11:44:29 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:58732)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tYpSM-0006lz-C9
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 11:44:26 -0500
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 <eliz@HIDDEN>)
 id 1tYpSE-0000S0-Iz; Fri, 17 Jan 2025 11:44:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=2o7jTWRf+zpfO+coCYrYtOD282qdFGDhTwFVsE1WATY=; b=eUDQveHjoChiGUMWv7xo
 3wVpObQW8ByfLInVHjJq/O+p6m7DxqmJkguzPqb4JCMpgoxDqvCafiO3vrsebGioAhE1Iw3hUhyNt
 3g48bw7o1CN4Nz927tjK89iDc9aSA8w0cnJV69MeBpmVaGqPwc9Kd0ryDBvla8DpoPTebSiOCTuif
 dFFD6oBH+OG1ASYxuNcSb+vqte58nP8WuPx9p4pl2gIozXBTb0hwW5eVDWFnkHDTETVTRjhUgQYtg
 eT9hG9iazUlh8iMcSJm8qKMgfaRe1NbqjPLGgG+SEPvN73wU7gXNYNTfnUkQpBX8IxcwUIiv9VAuG
 5uLf7VQfjISqcA==;
Date: Fri, 17 Jan 2025 18:43:57 +0200
Message-Id: <86frlhe6gi.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
In-Reply-To: <87bjw5ee1s.fsf@HIDDEN> (message from Robert Pluim on Fri, 17
 Jan 2025 14:59:59 +0100)
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
 <87jzateg41.fsf@HIDDEN> <86ikqdef44.fsf@HIDDEN> <87bjw5ee1s.fsf@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Robert Pluim <rpluim@HIDDEN>
> Cc: 75628 <at> debbugs.gnu.org,  ingo_brunberg@HIDDEN
> Date: Fri, 17 Jan 2025 14:59:59 +0100
> 
> >>>>> On Fri, 17 Jan 2025 15:36:59 +0200, Eli Zaretskii <eliz@HIDDEN> said:
> 
>     >> Cc: Ingo Brunberg <ingo_brunberg@HIDDEN>
>     >> From: Robert Pluim <rpluim@HIDDEN>
>     >> Date: Fri, 17 Jan 2025 14:15:26 +0100
>     >> 
>     Ingo> With a simple password some time ago, I could send mail.
>     >> 
>     >> Does this fix it? I guess at least "AUTH LOGIN" needs similar
>     >> treatment, and probably "AUTH CRAM-MD5". I donʼt think XOAUTH2 needs
>     >> it, but Iʼll check.
> 
>     Eli> If this is the fix, then how do you explain what the OP says, that
>     Eli> "some time ago" he could do this without problems?  Do you assume that
>     Eli> the "simple password" was plain-ASCII or something?
> 
> Yes
> 
>     Eli> The OP didn't show the data collected by report-emacs-bug, so we don't
>     Eli> know the locale's encoding in his case.  That could perhaps explain
>     Eli> the difference in behavior.
> 
>     Eli> Also, smtpmail-command-or-throw calls process-send-string, which
>     Eli> should already encode the command.  So the call to
>     Eli> encode-coding-string is almost certainly incorrect; if anything, we
>     Eli> should bind coding-system-for-write to 'utf-8'.  (Btw, how do we know
>     Eli> UTF-8 is the right encoding in this case? is that in some relevant
>     Eli> RFC?)
> 
> The encoding done by process-send-string is done after the base64
> encoding of the password used by the "AUTH PLAIN" command, so it
> doesnʼt help.
> 
> RFC 4616 specifies that the arguments to "AUTH PLAIN" are in UTF-8
> (prior to encoding with base64, see RFC 4954), so we should be
> encoding 'user' as well, strictly speaking.

OK, but then I think we need to bind coding-system-for-write to
no-conversion when calling smtpmail-command-or-throw in this
case. because the string is already encoded.




Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#75628: 31.0.50; Error sending mail using SMTP - base64 encoding fails
Resent-From: Robert Pluim <rpluim@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Fri, 17 Jan 2025 17:05:02 +0000
Resent-Message-ID: <handler.75628.B75628.173713346430315 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 75628
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: 
To: Eli Zaretskii <eliz@HIDDEN>
Cc: ingo_brunberg@HIDDEN, 75628 <at> debbugs.gnu.org
Received: via spool by 75628-submit <at> debbugs.gnu.org id=B75628.173713346430315
          (code B ref 75628); Fri, 17 Jan 2025 17:05:02 +0000
Received: (at 75628) by debbugs.gnu.org; 17 Jan 2025 17:04:24 +0000
Received: from localhost ([127.0.0.1]:38681 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tYplg-0007st-2O
	for submit <at> debbugs.gnu.org; Fri, 17 Jan 2025 12:04:24 -0500
Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:49223)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.84_2) (envelope-from <rpluim@HIDDEN>) id 1tYplc-0007sY-Ib
 for 75628 <at> debbugs.gnu.org; Fri, 17 Jan 2025 12:04:22 -0500
Received: by mail-wm1-x32b.google.com with SMTP id
 5b1f17b1804b1-43623f0c574so16049785e9.2
 for <75628 <at> debbugs.gnu.org>; Fri, 17 Jan 2025 09:04:20 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1737133454; x=1737738254; darn=debbugs.gnu.org;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id
 :reply-to; bh=cignJzwWhSdiOYojHGDZ4I9UxA4hhkcbA5NiDQXEAh0=;
 b=RjJIqysCpChgzePnF8VD+eHv8BWClOWbi6qqC4qw4WrJNTYkmk6RGu5JhtL8Gn1qfG
 4dOxItjLzYojPPHXV2sfp8h5EXc6ORca2HJ7pg5Li3Y9xfp8Fc7GfUNu5muWq2yU8s0Y
 tsO7+kbIt3o7/XReifVCgMnRTK9CPxLH9iiCnX7/XEUk4SHCwbXfvAMnf5JwW7/5k3+w
 /7kqUB4HLbFanT7wlBocNLqRpV69WGhd5Ll+xCdYdmaLrRgzsWwXOtESgsFYJd4narPn
 kLN5PJttUSHdG+HDzfuYv0korpagQJEo88k8NRA/U6H6Bv7aY8wm4sB82QkzapAnXQAL
 PiJQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1737133454; x=1737738254;
 h=content-transfer-encoding:mime-version:message-id:date:references
 :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=cignJzwWhSdiOYojHGDZ4I9UxA4hhkcbA5NiDQXEAh0=;
 b=YMUH6oooeyJenHoKCUtk/0Ue26Wodj7OAGVpIjkirT/aRDTyqN4RTMqplva37dAUIp
 dGpfWSzfdKGpUXDgb1Psr/cn/kfy7RXDMAB1G6t6oCi45TF3bwt9frTSeciFGb+kGOZY
 6WOtQJFdH903omEFYv4m7qILPakBme2CqC4qmXJQ/XSp4rrckfna98a0cInhlxZJ2mWO
 M3snwCtAK+0LLHemoo79yeqHxvrbrQ2mkNNi1knrmJ6bZESCxkhOxzdLSuSgw0l5mY7a
 Fvg6hKD9VrXULOPmJDmQIEHAthMAY7+kX+sAIrYUw3uLOYUrtEmnQ0rHS4mzCckOdUij
 F5GQ==
X-Gm-Message-State: AOJu0Yx8mVTrw1Z4ViK8fuiKPK96GvvKGT+9hFh83eygcDVyMSp9uHeh
 dttbjBQFoq8OvBExlEkEnlTbQ+79dSZ+98QROwaU6Rf3B4byXZjV
X-Gm-Gg: ASbGncv3Q9HFpfj3688ukWNGzwCCBYww+ZbOJAU16jCnkzzVom3WO0ZubMpqCN8s56U
 e4WS24/roGMU3HAsSMlgsBaGIQcpx1ePkoJ5MYTfRDTP9B+Qu+5iVM2y6FLe3h6W3YitfrucMPy
 IjIzyuixLSZlkNXXnI8ALLQj4RPpg0sKBDGh0GBoB906M0t99xiVJA7W1xTnwSkdhnDrbHcCPcC
 lU71TNf8TiHEn/5q4XwQCxDA58UIK/YXue+JeKOEtk=
X-Google-Smtp-Source: AGHT+IF6I/xbTYoc+RbU4MdOp7fmFB0UnUoP7+IOw19NmUmtQTug1n7Kx17zGTY3PrL4mkOOVuiPzA==
X-Received: by 2002:a05:600c:a03:b0:434:f7e3:bfbd with SMTP id
 5b1f17b1804b1-4389142e8b5mr36484565e9.23.1737133453925; 
 Fri, 17 Jan 2025 09:04:13 -0800 (PST)
Received: from rltb ([2a01:e0a:3f3:fb51:a8e5:fe72:1cb:767b])
 by smtp.gmail.com with ESMTPSA id
 5b1f17b1804b1-43890420412sm40493975e9.18.2025.01.17.09.04.13
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 17 Jan 2025 09:04:13 -0800 (PST)
From: Robert Pluim <rpluim@HIDDEN>
In-Reply-To: <86frlhe6gi.fsf@HIDDEN> (Eli Zaretskii's message of "Fri, 17 Jan
 2025 18:43:57 +0200")
References: <trinity-faaa80ad-9f2d-4964-89e3-f49a96c8f898-1737109132667@trinity-msg-rest-webde-webde-live-8d9fbf8c-vgkbm>
 <87jzateg41.fsf@HIDDEN> <86ikqdef44.fsf@HIDDEN>
 <87bjw5ee1s.fsf@HIDDEN> <86frlhe6gi.fsf@HIDDEN>
Date: Fri, 17 Jan 2025 18:04:12 +0100
Message-ID: <87wmetcqyb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

>>>>> On Fri, 17 Jan 2025 18:43:57 +0200, Eli Zaretskii <eliz@HIDDEN> said:

    Eli> OK, but then I think we need to bind coding-system-for-write to
    Eli> no-conversion when calling smtpmail-command-or-throw in this
    Eli> case. because the string is already encoded.

No need, the password is utf-8 encoded, then it=CA=BCs base64 encoded, then
it=CA=BCs concatenated with "AUTH PLAIN", and the result is then passed to
smtpmail-command-or-thow. So we can continue to use the value for
coding-system-for-write used by 'smtpmail-via-smtp', which is 'binary.

Robert
--=20





Last modified: Fri, 17 Jan 2025 17:15:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.