unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#45711: 27.1; Ambiguous account match in .authinfo still used by smtpmail
@ 2021-01-07 12:12 Duncan Bayne
  2021-01-09 14:39 ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Duncan Bayne @ 2021-01-07 12:12 UTC (permalink / raw)
  To: 45711

When I have an .authinfo file that contains multiple accounts for the
same host:

machine smtp.gmail.com login duncan@example.org password bazqux port 587
machine smtp.gmail.com login duncan@example.com password foobar port 587

... and have neglected to configure smptmail with the smtpmail-smtp-user
variable in either mu4e context, e.g.:

,(make-mu4e-context
  :name "example-com"
  :vars '((
           ;; Should contain, but doesn't ...
           ;; (smtpmail-smtp-user            . "duncan@example.com"

           (smtpmail-starttls-credentials . '(("smtp.gmail.com" 587 nil nil)))
           (smtpmail-default-smtp-server  . "smtp.gmail.com")
           (smtpmail-smtp-server          . "smtp.gmail.com")
           (smtpmail-smtp-service         . 587))))

... then smtpmail proceeds to authenticate with the *first* matching
account it finds.  So in this example, even if I'm using the
duncan@example.com context, it will log in as duncan@example.org.

(In practice this resulted in me sending email with the wrong From:
address, because Gmail unhelpfully and in violation of the relevant RFCs
re-writes the From: header to match the account to which you're logged
in, because STUFF YOU WE'RE GOOGLE.  Anyway.)

I think the correct behaviour here would be to have smtpmail to refuse
to send if there's an ambiguous account match in .authinfo.  I can't
off-hand think of a single case where I'd *want* it to just take the
first matching account where there are several possibilities.

Details from report-emacs-bug:

In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2020-11-03 built on duncan-w540
Repository revision: 7ff33faa62c0f3ca7b8dee9ec23671d650f827c5
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12009000
System Description: Ubuntu 20.10

Configured using:
 'configure --with-x=yes --with-x-toolkit=lucid
 --with-toolkit-scroll-bars --without-gconf --without-gsettings'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GLIB NOTIFY INOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD
PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_AU.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8

--
Duncan Bayne
+61 420 817 082 | https://duncan.bayne.id.au/

I usually check my mail every 24 - 48 hours.  If there's something
urgent going on, please send me an SMS or call me.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-11 15:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 12:12 bug#45711: 27.1; Ambiguous account match in .authinfo still used by smtpmail Duncan Bayne
2021-01-09 14:39 ` Ted Zlatanov
2021-01-09 23:30   ` Duncan Bayne
2021-01-10 14:33     ` Lars Ingebrigtsen
2021-01-11  2:02       ` Duncan Bayne
2021-01-11 15:18         ` Lars Ingebrigtsen
2021-01-10 14:43     ` Ted Zlatanov

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).