From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CFAC56DE0F3E for ; Tue, 3 Dec 2019 12:49:49 -0800 (PST) Authentication-Results: arlo.cworth.org; dkim=pass (2048-bit key; unprotected) header.d=iro.umontreal.ca header.i=@iro.umontreal.ca header.b="Zt7I+rH8"; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -2.401 X-Spam-Level: X-Spam-Status: No, score=-2.401 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9LFMsjFs7Evn for ; Tue, 3 Dec 2019 12:49:48 -0800 (PST) X-Greylist: delayed 592 seconds by postgrey-1.36 at arlo; Tue, 03 Dec 2019 12:49:47 PST Received: from mailscanner.iro.umontreal.ca (mailscanner.iro.umontreal.ca [132.204.25.50]) by arlo.cworth.org (Postfix) with ESMTPS id EDA2B6DE0F32 for ; Tue, 3 Dec 2019 12:49:47 -0800 (PST) Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id AF22B80273; Tue, 3 Dec 2019 15:39:51 -0500 (EST) Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id BC9E4811C0; Tue, 3 Dec 2019 15:39:49 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1575405589; bh=M0G41S/totZzkZ0A1qpsiKGwbah9giqEKun8eNtjh3I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Zt7I+rH8D9JN3YonbaFHDLhpBf5bPExmxpI/Kn5HVXNhyuiYzBFGIDq6qjQcVfQEF apu2SB9a0ZHE3Eo9u580wlgrUb0Pcf7WwO4SbIfhf/Jc2ppFB6PDgi7VB80QhHtkPR hXAvcuCDQ29g0ypBj7Bq4nMxQilj1WVNt0Q+ODddgQVBMgLwCt3U8fhmgoQ56sA3hm Ru9w8e9yf7HTPeBKsDchYrPCwkTbtEt3AsyCWQVkDp/jd/PFBCECjDcPlFIHTpk8tp YQ+gyqPH3GK/xbS1KpxteFeKco7Tv0PGyYp9YggX6amCx/Ly2Nfjb187WAngdsiY8n QOPD5iTHx8wlw== Received: from pastel (unknown [45.72.228.205]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 770891211C3; Tue, 3 Dec 2019 15:39:49 -0500 (EST) From: Stefan Monnier To: David Edmondson Cc: Gregor Zattler , notmuch Subject: Re: [BUG] notmuch-emacs: spoils sendmail -f with emacs 27 commit 3a59cc84069376802ba8fd731b524d78db58262c and later Message-ID: References: <87wobggee4.fsf@len.workgroup> Date: Tue, 03 Dec 2019 15:39:47 -0500 In-Reply-To: (David Edmondson's message of "Tue, 03 Dec 2019 18:43:00 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.007 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain X-Mailman-Approved-At: Wed, 04 Dec 2019 11:45:42 -0800 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Dec 2019 20:49:50 -0000 > disaster-area ~/s/emacs % ./src/emacs -Q -nw -batch --eval "(progn (require > 'message) (setq mail-specify-envelope-from t mail-envelope-from 'header) > (message \"%s\" message-sendmail-envelope-from))" > nil > disaster-area ~/s/emacs % Ha! Thanks for tracking it down. I installed the patch below into `master` to try and avoid this problem. Stefan diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el index f33454e704..e60ea4f0e8 100644 --- a/lisp/gnus/message.el +++ b/lisp/gnus/message.el @@ -854,18 +854,24 @@ message-sendmail-f-is-evil :type 'boolean) (defcustom message-sendmail-envelope-from - ;; `mail-envelope-from' is unavailable unless sendmail.el is loaded. - (if (boundp 'mail-envelope-from) mail-envelope-from) + 'obey-mail-envelope-from "Envelope-from when sending mail with sendmail. If this is nil, use `user-mail-address'. If it is the symbol `header', use the From: header of the message." - :version "23.2" + :version "27.1" :type '(choice (string :tag "From name") (const :tag "Use From: header from message" header) + (const :tag "Obey `sendmail-envelope-from'" + obey-mail-envelope-from) (const :tag "Use `user-mail-address'" nil)) :link '(custom-manual "(message)Mail Variables") :group 'message-sending) +(defun message--sendmail-envelope-from () + (if (eq message-sendmail-envelope-from 'obey-mail-envelope-from) + (if (boundp 'mail-envelope-from) mail-envelope-from) + message-sendmail-envelope-from)) + (defcustom message-sendmail-extra-arguments nil "Additional arguments to `sendmail-program'." ;; E.g. '("-a" "account") for msmtp @@ -5884,11 +5890,11 @@ message-user-mail-address (defun message-sendmail-envelope-from () "Return the envelope from." - (cond ((eq message-sendmail-envelope-from 'header) + (cond ((eq (message--sendmail-envelope-from) 'header) (nth 1 (mail-extract-address-components (message-fetch-field "from")))) - ((stringp message-sendmail-envelope-from) - message-sendmail-envelope-from) + ((stringp (message--sendmail-envelope-from)) + (message--sendmail-envelope-from)) (t (message-make-address)))) diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el index 1c2f11680b..fea7619b50 100644 --- a/lisp/mail/emacsbug.el +++ b/lisp/mail/emacsbug.el @@ -239,8 +239,8 @@ report-emacs-bug ;; Stop message-mode stealing the properties we will add. (set (make-local-variable 'message-strip-special-text-properties) nil) ;; Make sure we default to the From: address as envelope when sending - ;; through sendmail. - (when (and (not message-sendmail-envelope-from) + ;; through sendmail. FIXME: Why? + (when (and (not (message--sendmail-envelope-from)) (message-bogus-recipient-p (message-make-address))) (set (make-local-variable 'message-sendmail-envelope-from) 'header))) (rfc822-goto-eoh)