unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 43386@debbugs.gnu.org
Subject: bug#43386: 27.1; Regression in `report-emacs-bug'
Date: Mon, 14 Sep 2020 17:58:27 +0300	[thread overview]
Message-ID: <831rj4be24.fsf@gnu.org> (raw)
In-Reply-To: <874ko1dxdc.fsf@gnus.org> (message from Lars Ingebrigtsen on Mon,  14 Sep 2020 02:18:23 +0200)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Mon, 14 Sep 2020 02:18:23 +0200
> Cc: 43386@debbugs.gnu.org
> 
> > In any case, in Emacs 26.3 (and prior), even
> > though the From has that crazy text, when I use
> > C-c C-c and tell Emacs to use my mail client,
> > the mail client window pops up perfectly, and
> > yes, my mail client knows what my email address
> > is.  The buffer *sent mail to bug-gnu-emacs@gnu.org*
> > still has the crazy From text, but Emacs doesn't
> > bother me.
> 
> Emacs now requires that the From address is valid, as you've
> discovered.  (Sending bug reports from an "emacs -Q" is a pretty strange
> choice anyway, but that's up to you.)
> 
> Things seem to be working as designed, so I'm closing this bug report.

I think Drew is right here: we have a bug on our hands.

Look at the code:

  ;; Query the user for the SMTP method, so that we can skip
  ;; questions about From header validity if the user is going to
  ;; use mailclient, anyway.
  (when (or (and (derived-mode-p 'message-mode)
		 (eq message-send-mail-function 'sendmail-query-once))
	    (and (not (derived-mode-p 'message-mode))
		 (eq send-mail-function 'sendmail-query-once)))
    (sendmail-query-user-about-smtp)
    (when (derived-mode-p 'message-mode)
      (setq message-send-mail-function (message-default-send-mail-function))))
  (or report-emacs-bug-no-confirmation
      ;; mailclient.el does not need a valid From
      (if (derived-mode-p 'message-mode)
	  (eq message-send-mail-function 'message-send-mail-with-mailclient)
	(eq send-mail-function 'mailclient-send-it))
      ;; Not narrowing to the headers, but that's OK.
      (let ((from (mail-fetch-field "From")))
	(when (and (or (not from)
		       (message-bogus-recipient-p from)
		       ;; This is the default user-mail-address.  On
		       ;; today's systems, it seems more likely to
		       ;; be wrong than right, since most people
		       ;; don't run their own mail server.
		       (string-match (format "\\<%s@%s\\>"
					     (regexp-quote (user-login-name))
					     (regexp-quote (system-name)))
				     from))
	           (not (yes-or-no-p
		         (format-message "Is `%s' really your email address? "
                                         from))))

As you see, we _know_ that mailclient.el doesn't care about the faux
From address, and we have some logic to detect when this is the case.
But that logic doesn't work, because the conditions fail to match:

  (when (or (and (derived-mode-p 'message-mode)
		 (eq message-send-mail-function 'sendmail-query-once))
	    (and (not (derived-mode-p 'message-mode))
		 (eq send-mail-function 'sendmail-query-once)))
    (sendmail-query-user-about-smtp)
    (when (derived-mode-p 'message-mode)
      (setq message-send-mail-function (message-default-send-mail-function))))

The call to sendmail-query-user-about-smtp is the one that asks about
how to send, and allows to select mailclient.  But the conditions to
call it are false, and the rest is history.

I think this breakage is somehow related to our attempt to clean up
the sendmail.el/message.el mess.  So I suggest to look at how things
are supposed to work when message-mode is used by default, and see why
we miss the question about mailclient before asking about the From
address.





  parent reply	other threads:[~2020-09-14 14:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-13 21:30 bug#43386: 27.1; Regression in `report-emacs-bug' Drew Adams
2020-09-13 23:22 ` Lars Ingebrigtsen
2020-09-13 23:56   ` Drew Adams
2020-09-13 23:58     ` Lars Ingebrigtsen
2020-09-14  0:11       ` Drew Adams
2020-09-14  0:18         ` Lars Ingebrigtsen
2020-09-14  0:29           ` Drew Adams
2020-09-14 14:58           ` Eli Zaretskii [this message]
2020-09-14 16:15             ` Lars Ingebrigtsen
2020-09-15 13:28               ` Lars Ingebrigtsen
2020-09-15 14:51                 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831rj4be24.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=43386@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).