GNU bug report logs - #52205
Allow configuring multiple mail accounts for smtpmail.el

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Philip Kaludercic <philipk@HIDDEN>; Keywords: patch; dated Tue, 30 Nov 2021 19:46:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 22 Dec 2021 12:20:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 22 07:20:48 2021
Received: from localhost ([127.0.0.1]:57012 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1n00bw-0004nz-AP
	for submit <at> debbugs.gnu.org; Wed, 22 Dec 2021 07:20:48 -0500
Received: from quimby.gnus.org ([95.216.78.240]:48570)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1n00bq-0004nf-Dr
 for 52205 <at> debbugs.gnu.org; Wed, 22 Dec 2021 07:20:46 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=qlpQeNlWIJ1IJ6BmBisjU68wpoXg8oel1j57clkLeVg=; b=iWQcFNI5gghcU+I2GdvfLJAgcP
 /Ooo/lvw0A+VDQpUS2LeNZW0wIvNqloLt+x0GV4snXZevM0twtCqRp8K8JpJeyKPJXJU/HmdoCDZ5
 sfa56o4J46d7socKeFT2tZPunU/6JjazX7cT+X76R3XXKR1KLftdR7oRktgJ0J78OUrk=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1n00bg-0008K7-MQ; Wed, 22 Dec 2021 13:20:35 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
 <87sfv8u41f.fsf@HIDDEN> <87ee6s6vow.fsf@HIDDEN>
 <87ee6g71m1.fsf@HIDDEN> <87v8zrpam8.fsf@HIDDEN>
 <87bl1eqb5l.fsf@HIDDEN> <87bl1cyi8k.fsf@HIDDEN>
 <871r28mf28.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEXZUEb9/f3XqaTj
 09BVKyf////XUO5+AAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UMFgwEOH+rQS0AAAG4SURBVDjLdZON
 ccMgDIVlzAAWdAB+PIAFHYA67D9Tn3AvIU2iS862PiGJJyDiVwsLM9HyBqwKVm8EHy6zvwNSYAp+
 seT+Q+ny10ARQK3f9lsJ3Z7FAKSD1gs0/A0fljqenjeXaACroP84fSUKuQRRMNxk+2kb3G18VYoI
 7cjQbC+94VWzUdrIXNGt2yxBYzSBCYVEI/QbWzquPJaMkxAV2JO0S2dqQLxtCx85aj8mbkOXxE47
 VrCKAuEBPJQJqEc3PkxEPy2JU1BZ6wA0OWgZ7YmTP/mcdtVMQLvaSLwL7odEANezymMUly6XLXma
 EXLpHrMCkQm0AaAWjc09gOrWsDf4jxlcyduYoJd5xRioGRGzH2NEgR4HiJMfQx1A+F/tWjRXH8X8
 E8ilU9zho8zxCTh7SoKepGN4WCl1N6XcFLg0teV8wsH0XcE2F3GYwH5WzA4nq84r2MUa8o4V3qwz
 EKn8ZcIeiWdt0Qk6Kk0PDsvTRhwSi4O8LzctpSRbxxRfL1rF0YW9AlXyPcB8P4DvAWqqucImsLW3
 xVEEpxErnqPVvN5XLrmk/yvoU6pP7X4EG9n3qXYc01+TTl5+r2VD4gAAACV0RVh0ZGF0ZTpjcmVh
 dGUAMjAyMS0xMi0yMlQxMjowNDo1NiswMDowMIZzRTgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEt
 MTItMjJUMTI6MDQ6NTYrMDA6MDD3Lv2EAAAAAElFTkSuQmCC
X-Now-Playing: Morgan Caney & Kamal Joory's _Magic Radios_: "Take My Light"
Date: Wed, 22 Dec 2021 13:20:31 +0100
In-Reply-To: <871r28mf28.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 19 Dec 2021 21:59:27 +0000")
Message-ID: <877dbwg7ao.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > Ok, so how
 does this look like? Looks good to me, except this typo: 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Ok, so how does this look like?

Looks good to me, except this typo:

> -;;; message.el --- composing mail and news messages -*- lexical-binding: t -*-
> +;;; message.el --- composing mail and news messages -*- lexical- t -*-

So go ahead and push (but with a NEWS entry and some message.texi
documentation).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 19 Dec 2021 21:59:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 19 16:59:37 2021
Received: from localhost ([127.0.0.1]:48400 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mz4DR-0008Cy-5w
	for submit <at> debbugs.gnu.org; Sun, 19 Dec 2021 16:59:37 -0500
Received: from mout02.posteo.de ([185.67.36.66]:34719)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1mz4DO-0008Ci-RI
 for 52205 <at> debbugs.gnu.org; Sun, 19 Dec 2021 16:59:35 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 9BECA240101
 for <52205 <at> debbugs.gnu.org>; Sun, 19 Dec 2021 22:59:28 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1639951168; bh=xY4g2lGqVwzPBD4rEjBs7aGmEmL4gVmEnd8hXAmq+t8=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=NmOVYt+zoBidlQAqgof2DZAmgIjZiNhpD+ZeW5Z5mu2QDdg3lmocI4AkVwz+GOr9P
 wiOMwgoSQBYpA/MbvmbH+QRAZ6jusivA6c1VFZeq1H92EJctUFKuREiQpIsQLwIAnK
 sjJfuWAQ13Hie3etfkbvUATUvDFoJcKSjTkCqckQ/KYW8BnWY5ZOTC9yybnZrjE+mT
 iM8f8BmwccgzoRdv8DSl7Orr3MGEsLmksPATeBgvnuGDBHHfYPU8nlqAj+tIlj+aKu
 kspIyoR/89UeWfir0eXwG05TchEautk3iuLTz5z9YeD91RIg49++CNciUSjLxRTsK7
 DqKArDEYeiXqQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4JHGpR6Mr7z9rxL;
 Sun, 19 Dec 2021 22:59:27 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
 <87sfv8u41f.fsf@HIDDEN> <87ee6s6vow.fsf@HIDDEN>
 <87ee6g71m1.fsf@HIDDEN> <87v8zrpam8.fsf@HIDDEN>
 <87bl1eqb5l.fsf@HIDDEN> <87bl1cyi8k.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 19 Dec 2021 21:59:27 +0000
In-Reply-To: <87bl1cyi8k.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sun,
 19 Dec 2021 11:57:47 +0100")
Message-ID: <871r28mf28.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

--=-=-=
Content-Type: text/plain

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>>>>> Or we could add a command like `message-update-smtp-method-header' and
>>>>> people could call that (or add it to their hooks) after altering their
>>>>> From (or whatever) headers.
>>>>
>>>> So if the mechanism is supposed to be kept general (instead of just
>>>> checking the From header), how would this differ from the already
>>>> existing message-send-mail-hook?
>>>
>>> How a command would differ from a hook?  I'm not sure I understand the
>>> question.
>>
>> Oh, sorry I misunderstood your suggestion.  So you are thinking of
>> something that would be configured like:
>>
>> ;; `message-server-alist' would match the From header[0] if it is a string,
>> ;; or call a function in the current message buffer if it is a function.
>> (setq message-server-alist
>>       '(("foo@HIDDEN" . "smtp.mail.com")
>>         ("bar@HIDDEN" . "post-spuep.de")))
>>
>> (add-hook 'message-send-mail-hook #'message-update-smtp-method-header)
>
> No, I meant:
>
>>>>> Or we could add a command like `message-update-smtp-method-header' and
>>>>> people could call that
>
>> If so, then couldn't the add-hook just be dropped, and message always
>> checks message-server-alist before sending a message?
>
> Yes.

Ok, so how does this look like?


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline;
 filename=0001-Automatically-insert-X-Message-SMTP-Method-headers.patch

From c1dec09a725b440380a01c71435b24fc4cd905c0 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Sun, 19 Dec 2021 22:53:59 +0100
Subject: [PATCH] Automatically insert X-Message-SMTP-Method headers

* message.el (message-server-alist): Add user option
(message-update-smtp-method-header): Add function
(message-send): Call message-update-smtp-method-header
---
 lisp/gnus/message.el | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 285369b84c..24a12af3c9 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1,4 +1,4 @@
-;;; message.el --- composing mail and news messages -*- lexical-binding: t -*-
+;;; message.el --- composing mail and news messages -*- lexical- t -*-
 
 ;; Copyright (C) 1996-2021 Free Software Foundation, Inc.
 
@@ -4335,6 +4335,43 @@ message-bury
 
 (autoload 'mml-secure-bcc-is-safe "mml-sec")
 
+(defcustom message-server-alist nil
+  "Alist of rules to generate \"X-Message-SMTP-Method\" headers.
+If any entry of the form (COND . METHOD) matches, the header will
+be inserted just before the message is sent.  If COND is a
+string, METHOD will be inserted if the \"From\" header matches
+COND.  If COND is a function, METHOD will be inserted if COND
+returns a non-nil value, when called in the message buffer
+without any arguments.  If METHOD is nil in the last case, the
+return value of the function will be returned instead.  None of
+this applies if the buffer already has a\"X-Message-SMTP-Method\"
+header."
+  :type '(alist :key-type '(choice
+                            (string :tag "From Address")
+                            (function :tag "Predicate"))
+                :value-type 'string)
+  :version "29.1"
+  :group 'message-sending)
+
+(defun message-update-smtp-method-header ()
+  "Check `message-server-alist' to insert a SMTP-Method header."
+  (unless (message-fetch-field "X-Message-SMTP-Method")
+    (let ((from (mail-extract-address-components (message-fetch-field "From")))
+          method)
+      (catch 'exit
+        (dolist (server message-server-alist)
+          (cond ((functionp (car server))
+                 (let ((res (funcall (car server))))
+                   (when res
+                     (setq method (or (cdr server) res))
+                     (throw 'exit nil))))
+                ((and (stringp (car server))
+                      (string= (car server) from))
+                 (setq method (cdr server))
+                 (throw 'exit nil)))))
+      (when method
+        (message-add-header (concat "X-Message-SMTP-Method: " method))))))
+
 (defun message-send (&optional arg)
   "Send the message in the current buffer.
 If `message-interactive' is non-nil, wait for success indication or
@@ -4348,6 +4385,7 @@ message-send
   (undo-boundary)
   (let ((inhibit-read-only t))
     (put-text-property (point-min) (point-max) 'read-only nil))
+  (message-update-smtp-method-header)
   (message-fix-before-sending)
   (run-hooks 'message-send-hook)
   (mml-secure-bcc-is-safe)
-- 
2.30.2


--=-=-=
Content-Type: text/plain


This calls message-update-smtp-method-header before message-send-hook,
but I could also see adding message-update-smtp-method-header to the
hook in message.el, so that a user may remove it if needed.

-- 
	Philip Kaludercic

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 19 Dec 2021 10:58:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Dec 19 05:58:01 2021
Received: from localhost ([127.0.0.1]:44855 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1myttA-0005OB-RC
	for submit <at> debbugs.gnu.org; Sun, 19 Dec 2021 05:58:01 -0500
Received: from quimby.gnus.org ([95.216.78.240]:39846)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mytt9-0005Nx-Lq
 for 52205 <at> debbugs.gnu.org; Sun, 19 Dec 2021 05:58:00 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=BVHgG6YhRN5TDTrdJ2CSjbZoXGAj3ZSwLbNqEc0RM3Q=; b=Ohmap1/skFKhmK4X3XB6YDNuw1
 1pkiSPSnLLCXhtJvSSrBc/N7LWYMwPrdvM3hl0raMoeISGioHIuJ0/lIG0nt0Bj/o67+8FY3oumb4
 whzKGyPCpz5ht3gT7xRPGmH+v0gez9uCUFIQDgiw0LkXFOqDLI4L6ZeMfRsgCchD2bps=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mytt0-0002wx-EF; Sun, 19 Dec 2021 11:57:53 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
 <87sfv8u41f.fsf@HIDDEN> <87ee6s6vow.fsf@HIDDEN>
 <87ee6g71m1.fsf@HIDDEN> <87v8zrpam8.fsf@HIDDEN>
 <87bl1eqb5l.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEVFOiAwKx1bUz6V
 inH///+pG/jHAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UMEwojLIznq7UAAAGGSURBVDjLnZPrcQMx
 CISR3AAoDSDUwBn67y2L7qXYTn5EMx7r+A4WaTmiz6tQkY/rT0AkwvOJy9wxgju4C59/EzC91iE5
 wIsOH4A+SKP+HwC9mKUcq1o169nZARxPwkyEuOoCYoM+cdUKpBmZQCTChIpV1TJs2zUoxSOUhpmb
 sSNjEa/mIwYS+SpFEwRiYSOsmW+XRinDFcEijyy3LRkDFbxLrVAZNyDRlpta1chiO8+BX7e8CCsM
 gAyZgImpOU0gjP5OkM6MEf248lJvwAUn6KcZdwbjlvyMS9ULoK3dEryBKWiXeHqrGX94Z37eGpfj
 A/Va30dpip/kiazQ3eo5R4vZLVz0rRRanVoHOLYEG0Yt+7gd7e7T5/lC7XcGZ//CzfnIXUoVw7nc
 Wio84hSH82K9cDy/UK21Ua5rh4P25OEcZRVHzRIQHSZjg2Gst4YY3BqeJV+AWm8VQN4BpiOgldkr
 CE3glN+A0wpiDqiXdHjNGDYwapPVH6Xe13/AryuHZ7/Jn+sbputMyAgJJFsAAAAldEVYdGRhdGU6
 Y3JlYXRlADIwMjEtMTItMTlUMTA6MzU6NDMrMDA6MDAH3KJMAAAAJXRFWHRkYXRlOm1vZGlmeQAy
 MDIxLTEyLTE5VDEwOjM1OjQzKzAwOjAwdoEa8AAAAABJRU5ErkJggg==
X-Now-Playing: John and Beverley Martyn's _The Road to Ruin_: "Tree Green"
Date: Sun, 19 Dec 2021 11:57:47 +0100
In-Reply-To: <87bl1eqb5l.fsf@HIDDEN> (Philip Kaludercic's message of "Sat, 
 18 Dec 2021 13:45:42 +0000")
Message-ID: <87bl1cyi8k.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: >>>> Or we
 could add a command like `message-update-smtp-method-header' and >>>> people
 could call that (or add it to their hooks) after altering their >>>> From
 (or whatever) headers. >>> >>> So if t [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

>>>> Or we could add a command like `message-update-smtp-method-header' and
>>>> people could call that (or add it to their hooks) after altering their
>>>> From (or whatever) headers.
>>>
>>> So if the mechanism is supposed to be kept general (instead of just
>>> checking the From header), how would this differ from the already
>>> existing message-send-mail-hook?
>>
>> How a command would differ from a hook?  I'm not sure I understand the
>> question.
>
> Oh, sorry I misunderstood your suggestion.  So you are thinking of
> something that would be configured like:
>
> ;; `message-server-alist' would match the From header[0] if it is a string,
> ;; or call a function in the current message buffer if it is a function.
> (setq message-server-alist
>       '(("foo@HIDDEN" . "smtp.mail.com")
>         ("bar@HIDDEN" . "post-spuep.de")))
>
> (add-hook 'message-send-mail-hook #'message-update-smtp-method-header)

No, I meant:

>>>> Or we could add a command like `message-update-smtp-method-header' and
>>>> people could call that

> If so, then couldn't the add-hook just be dropped, and message always
> checks message-server-alist before sending a message?

Yes.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 18 Dec 2021 13:45:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 18 08:45:53 2021
Received: from localhost ([127.0.0.1]:41521 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mya25-00082Q-Cb
	for submit <at> debbugs.gnu.org; Sat, 18 Dec 2021 08:45:53 -0500
Received: from mout02.posteo.de ([185.67.36.66]:44475)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1mya23-00082D-H4
 for 52205 <at> debbugs.gnu.org; Sat, 18 Dec 2021 08:45:52 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 44C5E240101
 for <52205 <at> debbugs.gnu.org>; Sat, 18 Dec 2021 14:45:45 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1639835145; bh=ilX9VHHhtYYI5htFQy8kJyYc0lTgGAmohXd5XGISUI8=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=FiYSo9H8Hx1Eo1Bs0IEe59mgpDv1XmsZiNhvPfStYogCNbeS9jKiJM2VGaEryC1By
 tgrsro7dO/l1nhmUZH/eBARhptx+vuFt6jx00yuqttA0V0NdxRSPUkFnXz9Hs1Egkz
 v4r7zh519gn+lWXrI6Kw8gkA1c73Z2Nhei9P+LZuovCCKHxpu+i+YIAGF7C76/M9Zi
 U1H6luO8xaa6myc43i3s1H2TSS9mdPyCshMnSSeisxUWPkhzAa4/YIFF+JJ4KxCt3M
 A8Bnum4GVueagkEcco4H8XzY1J6xAwioyjFir0y1Ag8xe+RQdIh2ByZbDfR1za1ZyO
 ytAlGxTWydihA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4JGRvC6rcnz6tnQ;
 Sat, 18 Dec 2021 14:45:43 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
 <87sfv8u41f.fsf@HIDDEN> <87ee6s6vow.fsf@HIDDEN>
 <87ee6g71m1.fsf@HIDDEN> <87v8zrpam8.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sat, 18 Dec 2021 13:45:42 +0000
In-Reply-To: <87v8zrpam8.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Tue,
 14 Dec 2021 14:41:19 +0100")
Message-ID: <87bl1eqb5l.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>>> Or we could add a command like `message-update-smtp-method-header' and
>>> people could call that (or add it to their hooks) after altering their
>>> From (or whatever) headers.
>>
>> So if the mechanism is supposed to be kept general (instead of just
>> checking the From header), how would this differ from the already
>> existing message-send-mail-hook?
>
> How a command would differ from a hook?  I'm not sure I understand the
> question.

Oh, sorry I misunderstood your suggestion.  So you are thinking of
something that would be configured like:

--8<---------------cut here---------------start------------->8---
;; `message-server-alist' would match the From header[0] if it is a string,
;; or call a function in the current message buffer if it is a function.
(setq message-server-alist
      '(("foo@HIDDEN" . "smtp.mail.com")
        ("bar@HIDDEN" . "post-spuep.de")))

(add-hook 'message-send-mail-hook #'message-update-smtp-method-header)
--8<---------------cut here---------------end--------------->8---

If so, then couldn't the add-hook just be dropped, and message always
checks message-server-alist before sending a message?

[0] Using From is probably not enough, e.g. when you try to resend a message.

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 14 Dec 2021 13:41:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Dec 14 08:41:33 2021
Received: from localhost ([127.0.0.1]:57850 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mx83g-0002iI-Qg
	for submit <at> debbugs.gnu.org; Tue, 14 Dec 2021 08:41:33 -0500
Received: from quimby.gnus.org ([95.216.78.240]:40946)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mx83e-0002i3-Tx
 for 52205 <at> debbugs.gnu.org; Tue, 14 Dec 2021 08:41:31 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=L7rcz58G+IR8bPN6HoNKGfui/BvbNw2IGpzZLXmDIKM=; b=Fj30Mqy332eHwsWQcpzJny3OeV
 TPh+xG9SWjw4ziSzfIszPlUhhkzrAu58VQkrB1a/bGFWmA2bvpfyhFGu5RXwSKg2j9z1FTrOMBeZM
 LoDkegkx+VVhowOqV0tdZTcxRW503tyCd/7D2gLgEOnSwROGW3tOyBeMFTGz6g9DmljI=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mx83W-0000yd-Al; Tue, 14 Dec 2021 14:41:24 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
 <87sfv8u41f.fsf@HIDDEN> <87ee6s6vow.fsf@HIDDEN>
 <87ee6g71m1.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXp5OKzpqKKeHVS
 PTv///9X6rKaAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UMDg0OMB/wNNIAAAGSSURBVDjLbZMLtsMg
 CETRbgBxA4obaHT/e3sDfpK2j9M0jdeBwRIKhEiNI9OJqBTJnwNAuUHoADP+UZDnyh8gKGUqW1G+
 FMl3tvJRY6Zi/gV8in+DsH7m8lVjg1hiXbs5WY0bhLqyjMofYKUKqfWCzn8AtTau/xQkBsZxFesG
 quMNgM7hg5I8wRWbAQ+AGlaqBlDQudQFcIMpzjiPUQRZUtIKoC5lsh1SAXBXRLxCQrUA0EZNwTLJ
 AlXQc0hpDBgj3y72SSpFVNjAFUhPgFbp6qAracfjXAbIVdMGQ+b+jgvZsM2AzAY5ApinLuJgnLPS
 1n3SNNdsQE2BC+m6tX5AWwqYtWGJAJeDtP5o1LT5enVpVzup7shdxgTVgWUh+3r1tEAhq30GyhQz
 +LFqrq8b8BqzBdpcv4j4U6ELuCLcoLbu4E3TLq3X5AA2EA1M1auOCeirxgY2u/xk+QBbfXQC0JZb
 4mcy1d0epsT9LMdNp8KWps8FJG/F7ANgn8nYbu10Yc1f9gO6vxrknoN747COMPEfhaRNUtUweIMA
 AAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMTItMTRUMTM6MTQ6NDcrMDA6MDDwvXo3AAAAJXRFWHRk
 YXRlOm1vZGlmeQAyMDIxLTEyLTE0VDEzOjE0OjQ3KzAwOjAwgeDCiwAAAABJRU5ErkJggg==
X-Now-Playing: David Sylvian's _Brilliant Trees_: "Backwaters"
Date: Tue, 14 Dec 2021 14:41:19 +0100
In-Reply-To: <87ee6g71m1.fsf@HIDDEN> (Philip Kaludercic's message of "Mon, 
 13 Dec 2021 19:20:54 +0000")
Message-ID: <87v8zrpam8.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: >> Or we could
 add a command like `message-update-smtp-method-header' and >> people could
 call that (or add it to their hooks) after altering their >> From (or
 whatever) headers. > > So if the mechani [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

>> Or we could add a command like `message-update-smtp-method-header' and
>> people could call that (or add it to their hooks) after altering their
>> From (or whatever) headers.
>
> So if the mechanism is supposed to be kept general (instead of just
> checking the From header), how would this differ from the already
> existing message-send-mail-hook?

How a command would differ from a hook?  I'm not sure I understand the
question.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 13 Dec 2021 19:21:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 13 14:21:08 2021
Received: from localhost ([127.0.0.1]:56869 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mwqsl-0002ZH-S6
	for submit <at> debbugs.gnu.org; Mon, 13 Dec 2021 14:21:08 -0500
Received: from mout01.posteo.de ([185.67.36.65]:44655)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1mwqsg-0002XZ-Je
 for 52205 <at> debbugs.gnu.org; Mon, 13 Dec 2021 14:21:06 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 3F79124002B
 for <52205 <at> debbugs.gnu.org>; Mon, 13 Dec 2021 20:20:55 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1639423256; bh=l40ErVXPF/6iaEJXqrGfwgAPhhQuCM38DI0Fwh+FtC4=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=VFD6Z6FokSRDWr/ngduUZRNi+H4rFsaMENzhCh/C/IrQxxTEdD3raua50xzsn/Nsp
 8udVdP2QilwkVHtWO2Z/R00Ho3SCYF1aQu6ZlZ5jjm7wv/dD97kwJaTUy8ALCqWkye
 uj/95DMDPV5FA+tgaIUNWSRtwwukNvTq2Iorhv32MdjYGNX7Lz3AbfAu7xdEDMqMC/
 JcQ6QDKDZwUlbmDigpjRKzjbp8ov1KRKQEv6drp8mhiKX4Km+QHU9CKoT16QVF2U7u
 g7N8z67JT+hCYuPF31+WG+bKQwHt9vUXRUl75vu7S4nzTl/owaO0o5vYwPJwj8tRgM
 VaX65IC1fYV9A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4JCWZH1h1nz9rxG;
 Mon, 13 Dec 2021 20:20:54 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
 <87sfv8u41f.fsf@HIDDEN> <87ee6s6vow.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Mon, 13 Dec 2021 19:20:54 +0000
In-Reply-To: <87ee6s6vow.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Sat,
 04 Dec 2021 20:01:35 +0100")
Message-ID: <87ee6g71m1.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> Let's say I open a mail buffer with C-x m.  My default address is
>> inserted into the "From:" header. If I were to write my message, and
>> then decide to use my secondary address, I would either have to modify
>> the X-Message-SMTP-Method manually, or have it updated just before the
>> message is sent out.  The former is no improvement over the current
>> situation, and the second has the same potential for confusion, because
>> the user doesn't notice that the header is generated or updated.
>
> Or we could add a command like `message-update-smtp-method-header' and
> people could call that (or add it to their hooks) after altering their
> From (or whatever) headers.

So if the mechanism is supposed to be kept general (instead of just
checking the From header), how would this differ from the already
existing message-send-mail-hook?

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 4 Dec 2021 19:01:46 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 04 14:01:46 2021
Received: from localhost ([127.0.0.1]:54940 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mtaI6-00029n-KX
	for submit <at> debbugs.gnu.org; Sat, 04 Dec 2021 14:01:46 -0500
Received: from quimby.gnus.org ([95.216.78.240]:39748)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mtaI4-00029a-VV
 for 52205 <at> debbugs.gnu.org; Sat, 04 Dec 2021 14:01:45 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=7SoarsDPCB+xZIUK7TB9EM66PmcRX8wEsT+v+lM0vjg=; b=bfirxIt+t7iW9r3R+eIAqDO8qH
 Mq4Z9sr8f/OM++KAqGjiuSdDYSziaSZtxjkIaZZUNImjEsVUNlfqBck9ks4rRmZ0v31eUvVwi9CL+
 wiQwWw9IZ72ophRhnf22P/B07SHRwlN+hGHAsEMDNGB0xRMWuRU56VePRN7dKklQq4Og=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mtaHw-0007yu-B0; Sat, 04 Dec 2021 20:01:38 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
 <87sfv8u41f.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEUmKRpaTTSujlX/
 ///X3dOHAAAAAWJLR0QDEQxM8gAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB+UMBBIpNyOW
 Fz0AAAGSSURBVCjPLdExb+sgEADgu8pY72VyJfMkd3tj8yvsKHToRCqwVE8dbCnlV3TqnDyZDJ06
 mCrwK98dDov9AXccBwAAupQu3reQByEFq1c8pOi91Qj49Tr4ZGkYCugb65O3va5pj6mUSjNoscag
 chSNdk0nHf+IG3z+VCtSVBSRg4SNQ/8NoAAX+DPXaBdUe8KyuZh6PwpRMLb9DP0iHws+1IUBCZGi
 VRlcwkvQhAbK+G+GhirlzH0MFiZrBVd28caCnI3kY9GbCC9ze2gJ22QmtPuD0YT0NRtsoNYarpiG
 YOCXmJSA6104LJYuOFUSYnlSRwN3qukk+FL1R4NiLulU81faUNe/p1eLoN7k4KFqJLUN3gkWqm3J
 7bi+3esJqrQ5MfRBW+jScAPVuQsuo+aV5yUj1ve6g01037wyYksY3Zy34UmIrc5YAD9E4ZRbVrSy
 cM0N1Pji+J4TjBljSKcbavg5J07ArZPtT5euDKpWdlGs4NfqlsfEmQLj5RwyImP3GRLP8kPj0/M5
 8aznuz+5HeM/PQGRf75mSO8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjEtMTItMDRUMTg6NDE6NTUr
 MDA6MDBcmXhmAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIxLTEyLTA0VDE4OjQxOjU1KzAwOjAwLcTA
 2gAAAABJRU5ErkJggg==
X-Now-Playing: Tom Waits's _The Heart Of Saturday Night_: "A Sweet Little
 Bullet From A Pretty Blue Gun"
Date: Sat, 04 Dec 2021 20:01:35 +0100
In-Reply-To: <87sfv8u41f.fsf@HIDDEN> (Philip Kaludercic's message of "Sat, 
 04 Dec 2021 09:12:44 +0000")
Message-ID: <87ee6s6vow.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > Let's say
 I open a mail buffer with C-x m. My default address is > inserted into the
 "From:" header. If I were to write my message, and > then decide to use my
 secondary address, I would either have [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Let's say I open a mail buffer with C-x m.  My default address is
> inserted into the "From:" header. If I were to write my message, and
> then decide to use my secondary address, I would either have to modify
> the X-Message-SMTP-Method manually, or have it updated just before the
> message is sent out.  The former is no improvement over the current
> situation, and the second has the same potential for confusion, because
> the user doesn't notice that the header is generated or updated.

Or we could add a command like `message-update-smtp-method-header' and
people could call that (or add it to their hooks) after altering their
From (or whatever) headers.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 4 Dec 2021 09:12:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Dec 04 04:12:53 2021
Received: from localhost ([127.0.0.1]:52908 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mtR6D-0005hd-MY
	for submit <at> debbugs.gnu.org; Sat, 04 Dec 2021 04:12:53 -0500
Received: from mout01.posteo.de ([185.67.36.65]:55797)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1mtR6C-0005hP-8f
 for 52205 <at> debbugs.gnu.org; Sat, 04 Dec 2021 04:12:53 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 1BB94240027
 for <52205 <at> debbugs.gnu.org>; Sat,  4 Dec 2021 10:12:45 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1638609166; bh=v4Q6ZHIMyoaTp+JlsVkkKZ4HfnxlFvzP83QqmOLjeS4=;
 h=From:To:Cc:Subject:Date:From;
 b=j3tJ316PEiSP8/24x0PG2nZ8THAU7bwPIELiPPgdR5quqtTJIDhb2tf+tERa9L0HE
 0Msj/Av90+Mx6RLeFzx1jRkblZvKIte+/zgj7aEjiueNx43ohTSEoy5IEz90m58DVq
 gK8mPn2Yw+m9P+IgnVayxVaLH4w5MJnlgATSLfkkfIsUr2YgyCCgpMOly+E2f73ibk
 237eAxsjH8tZsUV46M6EBNvV36h3KtBs3s4kyiLCq0Po5IDl3iBhEUP8KBTL+n7vA5
 g3fuRFcN60Luy0iBka6pHbodliwAfmtdc/TOOjJoWOXESL2FKL0+xdYwCtPPw9+OdS
 Irg0I21L8w81A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4J5kVj2KNWz9rxQ;
 Sat,  4 Dec 2021 10:12:45 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN> <87wnklwtlw.fsf@HIDDEN>
Date: Sat, 04 Dec 2021 09:12:44 +0000
In-Reply-To: <87wnklwtlw.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Fri,
 03 Dec 2021 17:17:31 +0100")
Message-ID: <87sfv8u41f.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> Excuse me for asking, but confusing to whom?  It would seem consistent
>> if an order of priority like
>>
>> 1. Header
>> 2. server-alist/function
>> 3. default server
>>
>> would be guaranteed.
>
> The confusing bit comes when the user has configured several of these,
> and expects one of them to have a priority that it doesn't have.  By
> making this go through one single check point the priority becomes a
> non-issue.

I understand your point, but for this to work correctly I fear the
alternative could be more confusing.

Let's say I open a mail buffer with C-x m.  My default address is
inserted into the "From:" header. If I were to write my message, and
then decide to use my secondary address, I would either have to modify
the X-Message-SMTP-Method manually, or have it updated just before the
message is sent out.  The former is no improvement over the current
situation, and the second has the same potential for confusion, because
the user doesn't notice that the header is generated or updated.

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 3 Dec 2021 16:17:50 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 03 11:17:50 2021
Received: from localhost ([127.0.0.1]:52062 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mtBFu-00043E-8H
	for submit <at> debbugs.gnu.org; Fri, 03 Dec 2021 11:17:50 -0500
Received: from quimby.gnus.org ([95.216.78.240]:53968)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mtBFl-0003v1-8m
 for 52205 <at> debbugs.gnu.org; Fri, 03 Dec 2021 11:17:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=zI5n51NGysM4N5rcKhPtuNoIPVKA3tmp4INNC5aRuXU=; b=qkzfBV1gXk67IClS2t5ZgS/v+C
 vcaVbq2H9T5M0btwFeEcGVyyD0rdjGA6byzrYF9pvLyKRP3OdGDKYNn9g2y49j9ZlJ3iL8/voLjKJ
 w6AefkFbTB+AqueleoNdrVt4cA7ASA3QDuLMbvwIJWnWw7/iP67uzQuL7YImNEpynK+4=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mtBFb-0004Nt-KB; Fri, 03 Dec 2021 17:17:34 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
 <87fsratxmq.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAIVBMVEUaKE4fLVgmN2Uz
 R3VCU31Paptph7Q7UoV0l8etyuv////kMCoUAAAAAWJLR0QKaND0VgAAAAd0SU1FB+UMAxABIGNL
 0IcAAAGsSURBVDjLdZRBT8IwFMdfy4Fr20XxuHYhXhlj8gGUu0AKnDVOODIkeFYh4ywx9NvaMja7
 Ot7hpe0v7//+bdcBXApESD2ghNJ6QAXnwpQyP/DPKnkWXBgwSOSI5uIngJAQggM0s63sj00/xPMC
 PJ8lW4C7WSTnU8sIQg+96B5glTaT3ch2mI91/ZWchhTbvkzSC6gfdKioMY5XrVD4xhVUBVn3lrZ8
 UgXGORMRBP/2b2CQAnfBqdrLtwyOUpFrwKUgl9bIhWIBDdJa1rQZ9hePrGNKWEUUt5T6MEIr19SN
 Uj8E4uDZBddKqe0mk5/uwTfnykT25bhlKN6fwMFSMiAgjYVeP2bfqAoiQO+6/T45YFLonM48Ba11
 lFMa4tDujQ3IdkoQ4KQCBGex8UVQeVnIN5lt1nKmm3ccU4DXiZzs1fHJBWiSvHR7vYEFzs8jlqnX
 rRz4GWDuyfjVOnFUPijvDdrT0Cjn4qU9T49YGhXf4h/Afd1Dr58B80vR9n4Ig9KndcN4MtZWUA4Q
 t4zo6bKocADuFMB5/tgvAINqhMVd1/8vdPjVaeCAsq58tb/g3U0o0KJpyQAAACV0RVh0ZGF0ZTpj
 cmVhdGUAMjAyMS0xMi0wM1QxNjowMTozMiswMDowMOiXyCgAAAAldEVYdGRhdGU6bW9kaWZ5ADIw
 MjEtMTItMDNUMTY6MDE6MzIrMDA6MDCZynCUAAAAAElFTkSuQmCC
X-Now-Playing: Joni Mitchell's _Blue_: "A Case Of You"
Date: Fri, 03 Dec 2021 17:17:31 +0100
In-Reply-To: <87fsratxmq.fsf@HIDDEN> (Philip Kaludercic's message of "Thu, 
 02 Dec 2021 23:06:37 +0000")
Message-ID: <87wnklwtlw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > Excuse me
 for asking, but confusing to whom? It would seem consistent > if an order
 of priority like > > 1. Header > 2. server-alist/function > 3. default server
 > > would be guaranteed. 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> Excuse me for asking, but confusing to whom?  It would seem consistent
> if an order of priority like
>
> 1. Header
> 2. server-alist/function
> 3. default server
>
> would be guaranteed.

The confusing bit comes when the user has configured several of these,
and expects one of them to have a priority that it doesn't have.  By
making this go through one single check point the priority becomes a
non-issue.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 2 Dec 2021 23:06:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 02 18:06:49 2021
Received: from localhost ([127.0.0.1]:49608 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1msvA9-0000hR-0O
	for submit <at> debbugs.gnu.org; Thu, 02 Dec 2021 18:06:49 -0500
Received: from mout01.posteo.de ([185.67.36.65]:42317)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1msvA5-0000h8-B5
 for 52205 <at> debbugs.gnu.org; Thu, 02 Dec 2021 18:06:47 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 2E3FA240026
 for <52205 <at> debbugs.gnu.org>; Fri,  3 Dec 2021 00:06:38 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1638486399; bh=9R3EVWVgv9wqsD+mzLjkNdL4DqR3D06ZSJ4mR/HpbWY=;
 h=From:To:Cc:Subject:Date:From;
 b=UCBquD410vhyjEYAwRt9jVMvwGZNE2srkRzANNGWC8UyJTQHP5BV42zyvCeW94Wu0
 HebrKLLsD0GbzEHsqkiZBb1FFJ3a5JJrjCGHQ9uKex/DDdvu1KeVHRGtFa3UbeNO7P
 oZaHp2N7zklzzCfXY9tppyNuOpYc8uB3nFRMLLsaADPOyfB3yGF8qHD53mhwOv2pkJ
 W06fn5MitGFxFKk0oEl+6gW0U7d4mattZr6WiqRYOLvCGDySaRGRb07ZXmupEd2QtC
 qJzEMjK0gqMtRt/SLVZX31c9qqsqgdNG3LI+xP1pVOymg8yiS3ge3U/to5l+JNsnrO
 0r0ldywM5taqw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4J4s5p3G63z6tlh;
 Fri,  3 Dec 2021 00:06:38 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN> <87bl20f4zn.fsf@HIDDEN>
Date: Thu, 02 Dec 2021 23:06:37 +0000
In-Reply-To: <87bl20f4zn.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 01 Dec 2021 21:24:28 +0100")
Message-ID: <87fsratxmq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> While I do think it would be an improvement, I don't follow how it would
>> be preferable to implementing this in smtpmail?
>
> Because that seems like the right layer -- that is, having multiple ways
> to generate the header, instead of having some ways to generate the
> header and then some other bits that don't, but work "further down", is
> just confusing.

Excuse me for asking, but confusing to whom?  It would seem consistent
if an order of priority like

1. Header
2. server-alist/function
3. default server

would be guaranteed.

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 1 Dec 2021 20:24:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 01 15:24:42 2021
Received: from localhost ([127.0.0.1]:45859 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1msW9i-0000cp-O7
	for submit <at> debbugs.gnu.org; Wed, 01 Dec 2021 15:24:42 -0500
Received: from quimby.gnus.org ([95.216.78.240]:58476)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1msW9g-0000ca-Na
 for 52205 <at> debbugs.gnu.org; Wed, 01 Dec 2021 15:24:41 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=Um2ezFQ/t14xQ03hDPFPT5AAx3RBX44xze4r1NlLRzE=; b=Pjv1JuCldi3CmaHPRtBhNf+HQt
 Asx4UYP05f9cZMehYEwAn/UMnGgtksCzUQdOkLwoE7ZozOOk5YtMeeBJsn8lMcN/Kl/mQdVJjMyaV
 63F5j/BMyDrVQnaj/QTRliwNQT6I3HnCoBc0e3NZkMHxUx0XItxjusjmslg83Z6N0RgE=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1msW9X-0002Q8-HM; Wed, 01 Dec 2021 21:24:34 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
 <87pmqg13qp.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEUzFRZSKSJvSz6Y
 dGD////LkOz+AAAAAWJLR0QEj2jZUQAAAAd0SU1FB+UMARQXAOm9Jc8AAAGGSURBVDjLZZQBtusg
 CESlfwNCNhBwBdX97+0Ngqnme5o2xyvOgNhSfDDXWv4fxACF4n0HbYAQC98AGYkfsvsCKPQZd53A
 GeMZ0lo3ww++m1n/igbw0cdoV4/XPlqA5tPjGsVf8NpbdxM8CkmHr6sSKTH5nEdcX6Thhv8NCHG6
 4umMWJ3Atu2gRIRbruUED5l0qwBt80cEsek5/2ionRGUgGyB+tpKvgkoSZZfUqM+IulK5KWR4INa
 i2jG7BqmBnkJckQgEd8MTzlAh7iv16cmiTs0fD34YRfiJoL1vh2dGjEMcI9gC69qCkBbgtZCXJ4U
 l/i4Sbhsuf8AKlmZXq4InaQVNdYGoR0MdA5aqpJ9YytKgBY0MLNbDrtFZpc2//RDw3Pz7PEovwCk
 USvP5DjzmZuX/gVqVGoeyqHhwAVMJclyNWebA9PVjH4/P+yHLt2PRdfqqFkVrJS4JykfkVMlGoh+
 wG8dDm/mh7sT12zdFG81iYCVw2pv/zvxbegE9Wf+qO8+JvgDUnA61LOwoZUAAAAldEVYdGRhdGU6
 Y3JlYXRlADIwMjEtMTItMDFUMjA6MjM6MDArMDA6MDD2Omh7AAAAJXRFWHRkYXRlOm1vZGlmeQAy
 MDIxLTEyLTAxVDIwOjIzOjAwKzAwOjAwh2fQxwAAAABJRU5ErkJggg==
X-Now-Playing: Fairport Convention's _Come All Ye (3)_: "Flatpack Caper"
Date: Wed, 01 Dec 2021 21:24:28 +0100
In-Reply-To: <87pmqg13qp.fsf@HIDDEN> (Philip Kaludercic's message of "Wed, 
 01 Dec 2021 20:15:10 +0000")
Message-ID: <87bl20f4zn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: Philip Kaludercic <philipk@HIDDEN> writes: > While I do
 think it would be an improvement, I don't follow how it would > be preferable
 to implementing this in smtpmail? Because that seems like the right layer
 -- that is, having multiple ways to generate the header, instead of having
 some ways to generate the header and then some other bits that don't, but
 work "furth [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> While I do think it would be an improvement, I don't follow how it would
> be preferable to implementing this in smtpmail?

Because that seems like the right layer -- that is, having multiple ways
to generate the header, instead of having some ways to generate the
header and then some other bits that don't, but work "further down", is
just confusing.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 1 Dec 2021 20:15:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 01 15:15:23 2021
Received: from localhost ([127.0.0.1]:45819 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1msW0g-0000Mm-Qs
	for submit <at> debbugs.gnu.org; Wed, 01 Dec 2021 15:15:23 -0500
Received: from mout02.posteo.de ([185.67.36.66]:47347)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1msW0b-0000MS-U3
 for 52205 <at> debbugs.gnu.org; Wed, 01 Dec 2021 15:15:21 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 6A3FF240104
 for <52205 <at> debbugs.gnu.org>; Wed,  1 Dec 2021 21:15:11 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1638389711; bh=Ry1TDxd3nly4qran62R0dwy3lmDkbgIIj+EoAI86628=;
 h=From:To:Cc:Subject:Date:From;
 b=B1AffRyc0F8TiHEw7o4QYX5890d97nvyfpkk9jMjQQWa0hyhZ4gribfBie3yPLA+z
 +NVowAd+m9sVvxTTxGaAXsAU59nHy7yA8Z2Y+BQDSU+ToladdhyKjBZVJGuU72wedM
 C5U4wiQs5iM+C0JN2I6FWrZCCwka+k22QACsYd+iwNRjMF52wIhX/5JPhrhQTa6SEh
 0FqJMvixnf3Tvh2kwig5BVEheXj3P4pqR/ShuQRHatXb4C0eZPyw+q/mDWX8/0b253
 XiUr6zibeK8dD01n4CO312sLPBkyeqetrZLkjXZwyQjCHE8caT+yAHgWTPfy65cLxl
 wcwUhpOQRgFnQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4J49LQ5g9Jz6tmL;
 Wed,  1 Dec 2021 21:15:10 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN> <87k0gogmgn.fsf@HIDDEN>
Date: Wed, 01 Dec 2021 20:15:10 +0000
In-Reply-To: <87k0gogmgn.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 01 Dec 2021 20:21:44 +0100")
Message-ID: <87pmqg13qp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> The issue is that I am not writing using a MUA.  Sometimes I just open
>> C-x m directly or click on an email address, without Gnus being opened.
>> Sure, I can hook message-setup-hook to check from and insert
>> X-Message-SMTP-Method, but that's something everyone has to do for
>> themselves, over and over again.
>
> We could add a customisation to message-mode to insert the header based
> on the criteria, like matching on the headers?

While I do think it would be an improvement, I don't follow how it would
be preferable to implementing this in smtpmail?

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 1 Dec 2021 19:21:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 01 14:21:58 2021
Received: from localhost ([127.0.0.1]:45680 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1msVAz-0000e0-ST
	for submit <at> debbugs.gnu.org; Wed, 01 Dec 2021 14:21:58 -0500
Received: from quimby.gnus.org ([95.216.78.240]:57118)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1msVAy-0000dl-9u
 for 52205 <at> debbugs.gnu.org; Wed, 01 Dec 2021 14:21:56 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=ZL6z1A5B82tl1yFNS6BML7BGUVwq7fNt7n9Al/+QWxM=; b=Az3TOOiLPZPcfrX5To8wa2hNqk
 w3eHMcJUXIkGshrS4DuE09Qp83XG2gqT5nh9AAq4A8lJWTywZ/Lv8SimhQ6HufMQaUdnN5jWGT3oc
 nhb38eB0WX5gYaf8H3hJLvpJLFPyIjWfd1T9LBJ0jheZ+tCanvnJADa/5HRKv2421N84=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1msVAn-0001sk-9s; Wed, 01 Dec 2021 20:21:50 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
 <87bl20bswc.fsf@HIDDEN>
Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj
 SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEXJyMayr7OWlKBX
 V2P28xr///9HRQ2EAAAAAWJLR0QF+G/pxwAAAAd0SU1FB+UMARAVJ3mIWvoAAAG0SURBVDjLrZPr
 deQwCIWFtwHADRipgYzoYE/6r2kvV35McpJ/y5mxZX1CvFu7RMXMVM+vrb2JgJrhKVbrc88oahJc
 eN1B5H12SuI/C0isS2szYsFOUCqqVhRXrCvdsYsteCMqTeyUEKfReqjIZR+u2dZON8q9S0HpFZey
 vt6EQCsi+w5g25AOpdqjWBpCh+Xe1cqDNw/4yR9UgmoVz51E7AB5WHgxebIrfuCh1geve0v7HqUX
 e97ZvVSYLSGAPj/krVp7hsDJpx4MHu/McD+vKtfX22A7P+qUPxYq9CZb5utLH+hKraK0syokzRY5
 Tq25ZyrbZx3c4mynHJnHA2yfKvQgIVPuQtmKl2HMnMjyfmugA2ox8gBoMp6Oseoqz/zY42iSdCWu
 giK8MbeM9ie/1Xpkz8gJmzeIar8OlyrEGASXEQ+HQskFgl1A7gR9zGZ3w+JAh3WCPphitADOR8cb
 YNSgDLaBEZh3wJzj5QSqZyRRg2P5Gq/uAOw7GudIGXKFeQKgM6UgNWHlVa+ACtTi0uBwcvVMMpLo
 lcX+qnT66o2ouULgYGNN7d4+f5a/v4HP/wj+AQY+Z1k/V1ZPAAAAJXRFWHRkYXRlOmNyZWF0ZQAy
 MDIxLTEyLTAxVDE2OjIxOjM4KzAwOjAwkysLxAAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMS0xMi0w
 MVQxNjoyMTozOCswMDowMOJ2s3gAAAAASUVORK5CYII=
X-Now-Playing: DJ Rupture's _Curiosity Slowdown_: "Curiosity Slowdown (part 3)"
Date: Wed, 01 Dec 2021 20:21:44 +0100
In-Reply-To: <87bl20bswc.fsf@HIDDEN> (Philip Kaludercic's message of "Wed, 
 01 Dec 2021 09:01:39 +0000")
Message-ID: <87k0gogmgn.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > The issue
 is that I am not writing using a MUA. Sometimes I just open > C-x m directly
 or click on an email address, without Gnus being opened. > Sure, I can hook
 message-setup-hook to check from an [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> The issue is that I am not writing using a MUA.  Sometimes I just open
> C-x m directly or click on an email address, without Gnus being opened.
> Sure, I can hook message-setup-hook to check from and insert
> X-Message-SMTP-Method, but that's something everyone has to do for
> themselves, over and over again.

We could add a customisation to message-mode to insert the header based
on the criteria, like matching on the headers?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 1 Dec 2021 18:58:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 01 13:58:44 2021
Received: from localhost ([127.0.0.1]:45647 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1msUoV-0006Gr-SW
	for submit <at> debbugs.gnu.org; Wed, 01 Dec 2021 13:58:44 -0500
Received: from mout01.posteo.de ([185.67.36.65]:60771)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1msUoT-0006Gc-UO
 for 52205 <at> debbugs.gnu.org; Wed, 01 Dec 2021 13:58:42 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 698B8240029
 for <52205 <at> debbugs.gnu.org>; Wed,  1 Dec 2021 19:58:35 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1638385115; bh=Mv+qOWq4kR2T3mZTNLiRMJI0iyJbc4fcHcRhiUi2sVs=;
 h=From:To:Cc:Subject:Date:From;
 b=OU64oq3r6sjD+D06QS4JMdXMmenYltPDoeKaHiV+1wNKXTsj8asvoVS/LvRZGxoeu
 YKIemyZ6UUn4sfNi3RWiBf83FLlRdJDpKpdd0KlUDpE9ThsRZOK2NkbFyUj9YHZUmc
 LFu2JQ0/qTo1pS6UJAIWTT3NGm3HElo+49qPiyUQbXnDvoXRLCzWGsEgX/X1zoIMgV
 ItcYw+aRtrAW6eVY34BEwRoPytJlrP7unlvUrSnOf0TdtiGgMnM2RfFSEiLUiDfLcR
 XteHDvZ0NHouPLRbIC2pJiytHlVfl2U11PCH/Jjz/dKxM7N6RZhCwd7t7QyWQKQ273
 lHJVEwNy1jn6g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4J47f26NNPz9rwg;
 Wed,  1 Dec 2021 19:58:34 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
In-Reply-To: <87lf15arwk.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Wed,
 01 Dec 2021 05:08:27 +0100")
Date: Wed, 01 Dec 2021 09:01:39 +0000
Message-ID: <87bl20bswc.fsf@HIDDEN>
References: <87fsrdmnqx.fsf@HIDDEN> <87lf15arwk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.2 (-)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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: -2.2 (--)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Philip Kaludercic <philipk@HIDDEN> writes:
>
>> the below patch should allow for multiple mail accounts being configured
>> for smtpmail.el, without having to use tricks like
>> X-Message-SMTP-Method, that only work when the MUA also inserts them at
>> the right time.
>
> The problem is that there's no limit to how people want to configure
> their outgoing mail.

That might be the case, but this is certainly one popular use-case, at
least going by the activity seen on
https://www.emacswiki.org/emacs/MultipleSMTPAccounts.

>> +         (server (alist-get envelope-from smtpmail-smtp-server-alist
>> +                            (list smtpmail-smtp-server)
>> +                            nil #'string=))
>
> And using just the envelope-from might be correct for your use case, but
> it's not, in general, very useful.

Would it be better if a function were to be provided?  E.g. it would be
evaluated in the buffer and return the from address?

> If we want to add something like this to smtpmail, it has to allow a
> full range of customisations for how to determine the server...  and
> that's best done in the MUA, in my opinion.  Which is why it's
> implemented via a header so the MUA can do this.

The issue is that I am not writing using a MUA.  Sometimes I just open
C-x m directly or click on an email address, without Gnus being opened.
Sure, I can hook message-setup-hook to check from and insert
X-Message-SMTP-Method, but that's something everyone has to do for
themselves, over and over again.

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at 52205 <at> debbugs.gnu.org:


Received: (at 52205) by debbugs.gnu.org; 1 Dec 2021 04:08:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 30 23:08:39 2021
Received: from localhost ([127.0.0.1]:42936 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1msGv8-0002lm-WD
	for submit <at> debbugs.gnu.org; Tue, 30 Nov 2021 23:08:39 -0500
Received: from quimby.gnus.org ([95.216.78.240]:48664)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1msGv6-0002lW-Ug
 for 52205 <at> debbugs.gnu.org; Tue, 30 Nov 2021 23:08:37 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=tIWtp2tfhtjq0LWiraFVofdUTGC/sKUVPXz3v+Lmv3g=; b=j40qCQ7TdeHupfVKNuSjV2eZ96
 bkOagEwkWX8BrRS1q6+ld/QyXWDREmlnGi3ct+nmUJ1yIvJYluPNvsoP9LHq7adwfq1bEuVQOPEOv
 02ucGI8+Y165NyOUIFIKtn0BqZBcR/9KuqKUtKq/Ghs58PES5cTs5NF01zzY1Uvq8nq4=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1msGux-0003yh-Uf; Wed, 01 Dec 2021 05:08:31 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#52205: Allow configuring multiple mail accounts for
 smtpmail.el
References: <87fsrdmnqx.fsf@HIDDEN>
X-Now-Playing: Streifenjunko's _Like Driving_: "Like Driving"
Date: Wed, 01 Dec 2021 05:08:27 +0100
In-Reply-To: <87fsrdmnqx.fsf@HIDDEN> (Philip Kaludercic's message of "Tue, 
 30 Nov 2021 19:45:10 +0000")
Message-ID: <87lf15arwk.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: > the below
 patch should allow for multiple mail accounts being configured > for
 smtpmail.el, 
 without having to use tricks like > X-Message-SMTP-Method, that only work
 when the MUA also inserts them a [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 52205
Cc: 52205 <at> debbugs.gnu.org
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 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

> the below patch should allow for multiple mail accounts being configured
> for smtpmail.el, without having to use tricks like
> X-Message-SMTP-Method, that only work when the MUA also inserts them at
> the right time.

The problem is that there's no limit to how people want to configure
their outgoing mail.

> +         (server (alist-get envelope-from smtpmail-smtp-server-alist
> +                            (list smtpmail-smtp-server)
> +                            nil #'string=))

And using just the envelope-from might be correct for your use case, but
it's not, in general, very useful.

If we want to add something like this to smtpmail, it has to allow a
full range of customisations for how to determine the server...  and
that's best done in the MUA, in my opinion.  Which is why it's
implemented via a header so the MUA can do this.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 30 Nov 2021 19:45:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Nov 30 14:45:26 2021
Received: from localhost ([127.0.0.1]:42561 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ms949-0002W9-N9
	for submit <at> debbugs.gnu.org; Tue, 30 Nov 2021 14:45:26 -0500
Received: from lists.gnu.org ([209.51.188.17]:38602)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1ms947-0002W1-9x
 for submit <at> debbugs.gnu.org; Tue, 30 Nov 2021 14:45:23 -0500
Received: from eggs.gnu.org ([209.51.188.92]:49902)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1ms946-0003ek-Iy
 for bug-gnu-emacs@HIDDEN; Tue, 30 Nov 2021 14:45:23 -0500
Received: from mout02.posteo.de ([185.67.36.66]:47887)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1ms942-00081S-35
 for bug-gnu-emacs@HIDDEN; Tue, 30 Nov 2021 14:45:21 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 0BD36240103
 for <bug-gnu-emacs@HIDDEN>; Tue, 30 Nov 2021 20:45:11 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1638301512; bh=7o8+aF/RIYNoYF2uy1i6I9TijEP07DhJKir55cuQcBg=;
 h=From:To:Subject:Date:From;
 b=kKNqeLGkPs22Q0p3CWd7HYocNU/d7B98765ES2YBhvBaqdSGpTUPrB936W7VVtW+n
 HO7xcHq4FmCq7MJ65L5lBk3Ww5UT3tq+o5yr5z9L6TLEm+43g0LG/Y9AXrKUzEdegz
 60ddbBClYdj+pb5peEepNKI8eO3nkWlFwJeZIoiisb6JqRrJuYOD1Sh6EEyud8EYsv
 2gAHNFW5yyFygwfWYA0XWGGvDuZ6b8iF1MCuJd3PeUEJK07JbaoBh6QScFVYiWih4s
 Gq1tbWwwYARPZ18APEpXrHnmHA3lrIDxfJfrZBmk4NvRS9KGt0Q/VqzUlVaw5fuLhn
 CwXwnG/9FwOBQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4J3XkH2sWPz6tmq
 for <bug-gnu-emacs@HIDDEN>; Tue, 30 Nov 2021 20:45:11 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: Allow configuring multiple mail accounts for smtpmail.el
Date: Tue, 30 Nov 2021 19:45:10 +0000
Message-ID: <87fsrdmnqx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 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,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
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: -2.3 (--)

--=-=-=
Content-Type: text/plain

Tags: patch

Tags: patch


Hi,

the below patch should allow for multiple mail accounts being configured
for smtpmail.el, without having to use tricks like
X-Message-SMTP-Method, that only work when the MUA also inserts them at
the right time.

This is an initial patch, and everything seems to work on my end.  I had
a little issue with the indentation, because Emacs re-indented
everything at first, but I didn't want to send a patch consisting of
mainly unrelated whitespace changes.

In GNU Emacs 28.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo version 1.16.0)
 of 2021-11-30 built on viero
Repository revision: c4daff9cf844ec85930bdcd2064787c92c260861
Repository branch: emacs-28
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
Configured using:
 'configure CC=gcc
 PKG_CONFIG_PATH=/gnu/store/sfqc239vzd9d1hxmnvav385x1nl9zx5d-profile/lib/pkgconfig:/gnu/store/sfqc239vzd9d1hxmnvav385x1nl9zx5d-profile/share/pkgconfig:/home/philip/.guix-profile/lib/pkgconfig:/home/philip/.guix-profile/share/pkgconfig:/home/philip/.guix-profile/lib/pkgconfig:/home/philip/.guix-profile/share/pkgconfig'


--=-=-=
Content-Type: text/patch
Content-Disposition: attachment;
 filename=0001-Allow-configuring-multiple-mail-accounts-for-smtpmai.patch

From d4685683a265d53b28471e68c68ec8c6411e4aa7 Mon Sep 17 00:00:00 2001
From: Philip Kaludercic <philipk@HIDDEN>
Date: Tue, 30 Nov 2021 20:00:58 +0100
Subject: [PATCH] Allow configuring multiple mail accounts for smtpmail.el

* lisp/mail/smtpmail.el (smtpmail-smtp-server-alist): New option to
  configure what server to use for what outgoing address.
---
 lisp/mail/smtpmail.el | 31 ++++++++++++++++++++++++-------
 1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index bd8aa611e9..95e7abdeae 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -78,6 +78,19 @@ smtpmail-smtp-server
   "The name of the host running SMTP server."
   :type '(choice (const nil) string))
 
+(defcustom smtpmail-smtp-server-alist '()
+  "Alist of SMTP servers for different addresses."
+  :type '(alist :key-type
+                (string :tag "Sender")
+                :value-type
+                (list (string :tag "SMTP Server")
+                      (natnum :tag "Service")
+                      (choice :tag "Stream type"
+                              (const :tag "Possibly upgrade to STARTTLS" nil)
+                              (const :tag "Always use STARTTLS" starttls)
+                              (const :tag "Never use STARTTLS" plain)
+                              (const :tag "Use TLS/SSL" ssl)))))
+
 (defcustom smtpmail-smtp-service 25
   "SMTP service port number.
 The default value would be \"smtp\" or 25."
@@ -706,13 +719,9 @@ smtpmail-user-mail-address
 (defun smtpmail-via-smtp (recipient smtpmail-text-buffer
 				    &optional ask-for-password
                                     send-attempts)
-  (unless smtpmail-smtp-server
+  (unless (or smtpmail-smtp-server smtpmail-smtp-server-alist)
     (smtpmail-query-smtp-server))
-  (let ((process nil)
-        (send-attempts (or send-attempts 1))
-	(host (or smtpmail-smtp-server
-		  (error "`smtpmail-smtp-server' not defined")))
-	(port smtpmail-smtp-service)
+  (let* ((process nil)
         ;; `smtpmail-mail-address' should be set to the appropriate
         ;; buffer-local value by the caller, but in case not:
         (envelope-from
@@ -727,6 +736,14 @@ smtpmail-via-smtp
 	         (and from
 		      (cadr (mail-extract-address-components from))))
 	       (smtpmail-user-mail-address))))
+         (send-attempts (or send-attempts 1))
+         (server (alist-get envelope-from smtpmail-smtp-server-alist
+                            (list smtpmail-smtp-server)
+                            nil #'string=))
+         (host (or (car server)
+                   (error "No known SMTP Server for %S" envelope-from)))
+         (port (or (cadr server)
+                   smtpmail-smtp-service))
 	process-buffer
 	result
 	auth-mechanisms
@@ -757,7 +774,7 @@ smtpmail-via-smtp
 	    (setq result
 		  (open-network-stream
 		   "smtpmail" process-buffer host port
-		   :type smtpmail-stream-type
+		   :type (or (caddr server) smtpmail-stream-type)
 		   :return-list t
 		   :warn-unless-encrypted ask-for-password
 		   :capability-command (format "EHLO %s\r\n" (smtpmail-fqdn))
-- 
2.34.0


--=-=-=
Content-Type: text/plain


-- 
	Philip Kaludercic

--=-=-=--




Acknowledgement sent to Philip Kaludercic <philipk@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#52205; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 22 Dec 2021 12:30:02 UTC

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