bug#43386: 27.1; Regression in `report-emacs-bug'

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Drew Adams
From emacs -Q, when I use C-c C-c to send a bug report, it used to just
ask me how to send it, with "mail client" being the default.

Now it asks me whether <my
host>.i-did-not-set--mail-host-address--so-tickle-me is really my email
address.  When I say no, it just ends the interaction.

This is a regression.  What's more, after I edit that default From field
to provide my email address, it asks whether I want to save this.  I
answer yes, but it makes no difference.  Another M-x report-emacs-bug,
at least in the same session, shows that it still uses that default From
text.

All of this is a regression, I believe.  I can easily use M-x
report-emacs-bug from emacs -Q with other releases, and not have to jump
through any such hoops.


In GNU Emacs 27.1 (build 1, x86_64-w64-mingw32)
 of 2020-08-12 built on CIRROCUMULUS
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Repository branch: HEAD
Windowing system distributor 'Microsoft Corp.', version 10.0.18362
System Description: Microsoft Windows 10 Pro (v10.0.1903.18362.1016)



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Lars Ingebrigtsen
Drew Adams <[hidden email]> writes:

>>From emacs -Q, when I use C-c C-c to send a bug report, it used to just
> ask me how to send it, with "mail client" being the default.
>
> Now it asks me whether <my
> host>.i-did-not-set--mail-host-address--so-tickle-me is really my email
> address.  When I say no, it just ends the interaction.

It asks you to edit the From address, which you should do.  (But it
should place point on the From line instead of leaving it at the end of
the buffer; I've now fixed this on the trunk.)

> This is a regression.

Nope.

> What's more, after I edit that default From field to provide my email
> address, it asks whether I want to save this.  I answer yes, but it
> makes no difference.  Another M-x report-emacs-bug, at least in the
> same session, shows that it still uses that default From text.

It doesn't ask me that.  Perhaps you're thinking of the next question
you're getting -- which mail transport to use?

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



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Drew Adams
> >>From emacs -Q, when I use C-c C-c to send a bug report, it used to just
> > ask me how to send it, with "mail client" being the default.
> >
> > Now it asks me whether <my
> > host>.i-did-not-set--mail-host-address--so-tickle-me is really my email
> > address.  When I say no, it just ends the interaction.
>
> It asks you to edit the From address, which you should do.  (But it
> should place point on the From line instead of leaving it at the end of
> the buffer; I've now fixed this on the trunk.)

I should not have to do that each time.  No.

> > This is a regression.
>
> Nope.

I believe it is.  I don't see it in any earlier Emacs release.

> > What's more, after I edit that default From field to provide my email
> > address, it asks whether I want to save this.  I answer yes, but it
> > makes no difference.  Another M-x report-emacs-bug, at least in the
> > same session, shows that it still uses that default From text.
>
> It doesn't ask me that.  Perhaps you're thinking of the next question
> you're getting -- which mail transport to use?

No.  That's a separate question.  That one I expect,
and that one I get also in earlier releases.

And after going through the whole thing once
(including answering whether I want to save the
updated email address), the next time in the same
session I don't get that do-you-want-to-save-it
question.

But even after saying I wanted to save it, I still
get, in the same session, the same old <my host>.
i-did-not-set--mail-host-address--so-tickle-me
address, and not the edited and saved address.



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Lars Ingebrigtsen
Drew Adams <[hidden email]> writes:

>> > What's more, after I edit that default From field to provide my email
>> > address, it asks whether I want to save this.  I answer yes, but it
>> > makes no difference.  Another M-x report-emacs-bug, at least in the
>> > same session, shows that it still uses that default From text.
>>
>> It doesn't ask me that.  Perhaps you're thinking of the next question
>> you're getting -- which mail transport to use?
>
> No.  That's a separate question.  That one I expect,
> and that one I get also in earlier releases.
>
> And after going through the whole thing once
> (including answering whether I want to save the
> updated email address), the next time in the same
> session I don't get that do-you-want-to-save-it
> question.

What is the question it asks you, exactly?

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



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Drew Adams
> What is the question it asks you, exactly?

"Save this mail sending choice? (y or n)"

That's posed after I edit the address, try C-c C-c
again, and tell it I want to use "mail client".

It correctly pops up my mail client's (Outlook)
new mail window (where I can paste the bug report
text).  But in Emacs I get that follow-up prompt
asking whether to save the mail sending choice.

I think when I filed the bug report I was
misremembering the question to be about saving
the email address instead of saving my choice of
"mail client".

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 [hidden email]*
still has the crazy From text, but Emacs doesn't
bother me.  C-c C-c and saying "mail client" is
sufficient.  I'm not prevented from filling out
a mail message in my client and sending it.
Nothing annoying in Emacs 26.3 (or prior).




Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Lars Ingebrigtsen
Drew Adams <[hidden email]> writes:

>> What is the question it asks you, exactly?
>
> "Save this mail sending choice? (y or n)"

Yes, that's about saving the MTA setup, and has nothing to do with the
From address.

> 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 [hidden email]*
> 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.

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



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Drew Adams
> >> What is the question it asks you, exactly?
> >
> > "Save this mail sending choice? (y or n)"
>
> Yes, that's about saving the MTA setup, and has nothing to do with the
> From address.
>
> > 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 [hidden email]*
> > 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.

That makes no sense whatsoever.

IF a user says to use THE MAIL CLIENT then it's up
to the user to provide the From field TO THE MAIL
CLIENT.  And typically the mail client will always
prefill that field correctly - the client knows the
user.

This is a ridiculous annoyance.  My guess is that
whoever implemented this did not take into account
the use case of sending via THE MAIL CLIENT.

The mail client makes NO USE of the From field
from Emacs.  (At least mine makes no use of it.)

Please DTRT, and fix this regression.

And yes, there are good reasons to sometimes submit
a bug report using emacs -Q.  I don't usually do
that, but sometimes I do.

Emacs should certainly NOT assume that there's NO
reason for it to support sending a report from
emacs -Q.  It's never done that, and it never should.



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Eli Zaretskii
In reply to this post by Lars Ingebrigtsen
> From: Lars Ingebrigtsen <[hidden email]>
> Date: Mon, 14 Sep 2020 02:18:23 +0200
> Cc: [hidden email]
>
> > 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 [hidden email]*
> > 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.



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Lars Ingebrigtsen
Lars Ingebrigtsen <[hidden email]> writes:

> So to make this work sensibly requires some refactoring of the code.
> I'll have a look at it tomorrowish.

Now done.

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



Reply | Threaded
Open this post in threaded view
|

bug#43386: 27.1; Regression in `report-emacs-bug'

Eli Zaretskii
> From: Lars Ingebrigtsen <[hidden email]>
> Cc: [hidden email],  [hidden email]
> Date: Tue, 15 Sep 2020 15:28:02 +0200
>
> Lars Ingebrigtsen <[hidden email]> writes:
>
> > So to make this work sensibly requires some refactoring of the code.
> > I'll have a look at it tomorrowish.
>
> Now done.

Thanks!