From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#29427: Problem sending emails in message-mode after restart Date: Fri, 24 Nov 2017 10:33:39 -0800 Message-ID: <87tvxj5xx8.fsf@ericabrahamsen.net> References: <87lgivfyl5.fsf@soma.i-did-not-set--mail-host-address--so-tickle-me> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1511548690 28261 195.159.176.226 (24 Nov 2017 18:38:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 24 Nov 2017 18:38:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: 29427@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 24 19:38:05 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIIrV-0006xn-1T for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Nov 2017 19:38:05 +0100 Original-Received: from localhost ([::1]:50685 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIIrc-0006oT-4E for geb-bug-gnu-emacs@m.gmane.org; Fri, 24 Nov 2017 13:38:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIIob-0004ZI-8n for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 13:35:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIIoY-0005wZ-2k for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 13:35:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47653) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eIIoX-0005wS-WD for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 13:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eIIoX-0001zU-QD for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 13:35:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87lgivfyl5.fsf@soma.i-did-not-set--mail-host-address--so-tickle-me> Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Nov 2017 18:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 29427 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15115484517588 (code B ref -1); Fri, 24 Nov 2017 18:35:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Nov 2017 18:34:11 +0000 Original-Received: from localhost ([127.0.0.1]:56334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIInh-0001yI-4J for submit@debbugs.gnu.org; Fri, 24 Nov 2017 13:34:09 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:33095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eIInf-0001y5-Nm for submit@debbugs.gnu.org; Fri, 24 Nov 2017 13:34:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIInZ-00051r-QD for submit@debbugs.gnu.org; Fri, 24 Nov 2017 13:34:02 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:41680) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eIInZ-00051Z-Nm for submit@debbugs.gnu.org; Fri, 24 Nov 2017 13:34:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eIInY-0004Vd-NR for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 13:34:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eIInV-0004xB-FP for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 13:34:00 -0500 Original-Received: from [195.159.176.226] (port=35791 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eIInV-0004wd-76 for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 13:33:57 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1eIInJ-0006of-TL for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2017 19:33:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:NATEiZ4OG499N0QWgqFOYmzGfDg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:140328 Archived-At: Emmanuel Boudreault writes: > Hello, > > I seem to be having an odd bug sending e-mails. I've configured msmtp to > send e-mails. When I first send an e-mail in emacs, 'send-mail-function' > isn't defined, I get a prompt, I choose transport and everything works > as expected. The msmtp log shows that the from field is properly set to > 'emmanuel.boudreault@polymtl.ca'. This keeps working until emacs is > restarted. > > When I restart emacs, 'send-mail-function' is defined. When I try to > send an e-mail, it fails saying the From field is incorrect. When I look > at the From field in the msmtp log it shows that emacs generated a From > field even though there was a valid one in the e-mail header. The From > field is: 'manu@soma.i-did-not-set--mail-host-address--so-tickle-me'. > The 'send-mail-function' is set to '(quote sendmail-send-it)'. This happens when the variable `user-mail-address' is not set (or `message-user-fqdn', or `mail-host-address'). I assume you have one of those variables set in one of your init files, and that init file is not automatically loaded. I'm not sure how `send-mail-function' comes into it, and am a bit confused by your report: you say when you first send an email in emacs, it isn't set, but later say when you restart emacs, it is defined. Anyway, if you're using something based on message-mode, you should probably just set `message-send-mail-function' directly. HTH, Eric