From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: rameiko87@posteo.net Newsgroups: gmane.emacs.bugs Subject: bug#68686: [Bug] smtpmail-send-queued-mail ignores some headers of the message it's sending! Date: Sat, 27 Jan 2024 01:09:19 +0000 Message-ID: <7a703be21678dd05c33bf3c151bfb982@posteo.net> References: <87v87i7mb1.fsf@ledu-giraud.fr> <435ab85bfa3b3fbc9e923a14c3b3e260@posteo.net> <87o7d96cgk.fsf@ledu-giraud.fr> <51d627dbca03e8fda8de98d03f2d1a4a@posteo.net> <87v87hzo1n.fsf@ledu-giraud.fr> <094563e74393ed00d08647ed6bfaf4e6@posteo.net> <871qa4xfzy.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4404"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 68686@debbugs.gnu.org To: Manuel Giraud Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 27 02:10:23 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rTXDD-0000wc-Dg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 27 Jan 2024 02:10:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rTXCo-0003yF-DT; Fri, 26 Jan 2024 20:09:58 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rTXCn-0003y6-7S for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 20:09:57 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rTXCm-0004QG-Ug for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 20:09:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rTXCs-0000nb-FG for bug-gnu-emacs@gnu.org; Fri, 26 Jan 2024 20:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: rameiko87@posteo.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jan 2024 01:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68686 X-GNU-PR-Package: emacs Original-Received: via spool by 68686-submit@debbugs.gnu.org id=B68686.17063177773033 (code B ref 68686); Sat, 27 Jan 2024 01:10:02 +0000 Original-Received: (at 68686) by debbugs.gnu.org; 27 Jan 2024 01:09:37 +0000 Original-Received: from localhost ([127.0.0.1]:53097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTXCT-0000mq-19 for submit@debbugs.gnu.org; Fri, 26 Jan 2024 20:09:37 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:33055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rTXCP-0000mU-JR for 68686@debbugs.gnu.org; Fri, 26 Jan 2024 20:09:35 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 790A6240027 for <68686@debbugs.gnu.org>; Sat, 27 Jan 2024 02:09:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1706317760; bh=DB4sqUAypHK0tbhEWql1FFk5HhrUXG8QE7F81DkcO+Y=; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Date:From:To: Cc:Subject:Message-ID:From; b=UnwRmoYKFFw/4eofyN07gjMX96vjENrZm5hmHlSXGBUMszsGVAvvlWMbB+Tsg5hSY fHu6BY2UaiUQWRsZ9XnPHHTFCnmBPvD4qTUDSgzdfSv0zELdGYzB24Cw7kdzGd4Yb7 8Y0maiac+Q9rbZfvjphYDOQBN/63Ec3o/wHSGNLXfNUWl7pS0vcHgYkEv0cjjTMCNz JiG+RX47T0JKQtuUtqWBNjqjogl4p6nz7BOE7euTMzm02AMu+C3lI0+G4RGWb/bQXu S+XCqDTdKkhjqj5VYVITz1Q8ojrqojhZLCuOYqLf9qWKhhxPO7H8GOtPowbfD/hbk+ FAEtPDEXFrSjg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4TMGg36cDgz9rxB; Sat, 27 Jan 2024 02:09:19 +0100 (CET) In-Reply-To: <871qa4xfzy.fsf@ledu-giraud.fr> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:278955 Archived-At: On 26.01.2024 16:37, Manuel Giraud wrote: > >> Please do, because 29.2 is not packaged for guix, so I don't know how >> to install it. Otherwise I would test myself with 29.2... > > Hi, > > So I did the following test on 29.1 (built from source from the > emacs-29.1 branch): > > - emacs -Q > - M-: (setq send-mail-function 'smtpmail-send-it > smtpmail-queue-mail t > smtpmail-smtp-server "ledu-giraud.fr") > - M-: (compose-mail) > [ manually change "To:" and "From:" to manuel@ledu-giraud.fr ] > - C-c C-c > - M-: (smtpmail-send-queued-mail) > > And this mail is correctly delivered. The only trace left of the local > hostname is in "Message-ID:" which was set to > <87dvxoapt1.fsf@computer.mail-host-address-is-not-set> > > So, I cannot see evidence of a bug in Emacs here. Ok I think I solved the conundrum! It has to do with the "envelope From", and I think the reason why you can't reproduce the error is because your smtp server allows envelope-from which are different from the From: header (and my smtp server doesn't). So you don't _see_ the bug. Let's keep start emacs -Q and let's set the parameters we discussed. For some reason, the envelope-from when sending via smtpmail-send-queued-mail is assigned to the value of user-mail-address (which for me was user@fedora) independently of the From: header. But with "immediate sending" this doesn't happen (I wonder if it's assigned to the same value as the header, or is not assigned at all and the smtp server assigns it? I don't know much about how these protocols work). In fact, if I just set a valid email for user-mail-address, then I get a different error, that is "envelope-from mismatches the From: header". Now, I could solve it by fiddling with '(mail-envelope-from 'header) '(mail-specify-envelope-from t) and at this point I can send queued email, but this is really a fishy business and this fact that the value assigned to envelope-from changes between using "immediate sending" and queued-sending I think is the real core of the bug. Because I don't want the envelopes which I prescribed above to insert a header X-Authentication-Warning in my message, then I set '(message-sendmail-f-is-evil t), and looking at the description of this variable I discover it mentions bug#36937 which is very similar to the strange behaviour I described. I will try to explore, with more calm and over the next few weeks, what is going on. But this is really a fishy business!