From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Duncan Bayne Newsgroups: gmane.emacs.bugs Subject: bug#45711: 27.1; Ambiguous account match in .authinfo still used by smtpmail Date: Thu, 07 Jan 2021 23:12:09 +1100 Message-ID: <87lfd5osiu.fsf@bayne.id.au> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13141"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.13; emacs 27.1 To: 45711@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 07 13:13:18 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxUAH-0003Cb-LV for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jan 2021 13:13:18 +0100 Original-Received: from localhost ([::1]:44064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kxUAG-0000lv-3b for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Jan 2021 07:13:16 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxUA2-0000ln-7t for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 07:13:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35178) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kxUA2-0000HU-1M for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 07:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kxUA1-0000dH-TO for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 07:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Duncan Bayne Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Jan 2021 12:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45711 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16100215432378 (code B ref -1); Thu, 07 Jan 2021 12:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Jan 2021 12:12:23 +0000 Original-Received: from localhost ([127.0.0.1]:46724 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxU9P-0000cI-1X for submit@debbugs.gnu.org; Thu, 07 Jan 2021 07:12:23 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:38160) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kxU9M-0000cA-L4 for submit@debbugs.gnu.org; Thu, 07 Jan 2021 07:12:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxU9M-0000ia-GA for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 07:12:20 -0500 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:42403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kxU9J-0008Ik-DY for bug-gnu-emacs@gnu.org; Thu, 07 Jan 2021 07:12:20 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6E11D5C0195; Thu, 7 Jan 2021 07:12:15 -0500 (EST) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 07 Jan 2021 07:12:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bayne.id.au; h= from:to:subject:message-id:date:mime-version:content-type; s= fm2; bh=G/N2F0gTSEbvc7j4TmhpPdsRcWkwvgzHDhVDQYh9xF0=; b=W2f8CS+x 6cE18v6oN7H8xzfGAWKRHsNZ/iK6oAfuD7rrePYL7pKsZ2qeo5gRrU8KYompmEj9 P9L86xtL6XBQ6dfDXQLtp9t+UiCk3icrwm+ZFxCRaOoocZyc171lYj6jb/7m7EMI CBRLgguUnn2i9EEuUOSdmEKLc4XMZOYONnthpXF6l24kFytF2u8nRv0w90qJ8WAB eF6HnLZscWg5J23rBQ8uGOk6cXk6+wzkiVhR5dn5FyS7p+/cYy9/8Q93hl8lJKML cvbY76rYNTO4y4e7rbed204je6rdWCLIkDSXEKsn+shMiDFdMeOHE4XbqoQ3jQlX tD0HwXBVcfmkaA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=G/N2F0gTSEbvc7j4TmhpPdsRcWkwv gzHDhVDQYh9xF0=; b=c3XAgBBd+kLfCFQhTwZzGZO3C4+hLkOpORqk3JY30L4Tq xS/PPVKIZxQPasp9UgyIWYJ+l+5JUDBtZchE4/YDbheWsBO+eQhK4YAR8ua17x9X hGt5j9og/VJO0QQLVvl5AuJCYociTa5fzymOwoRZ7I2G1b9ngzupiiWO0FN8ml2G FML1wal0rEvFyYWsQJkXMgWREbI9VRycP6KMy3cBvVTKMj2iiAa1hjAjMPdU5TMb mQDRhGktY7OJVwlxhNiKhY6HxgeDWtNxiA2UFiSVy8lbVpiSZQoI91x5GGVl2vq1 +65yYV7AiQYNkfOxWl1kute5rHqNzhNaJEPzGlfTQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdegvddgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegfhffvuffkffggtgesthdtredttd ertdenucfhrhhomhepffhunhgtrghnuceurgihnhgvuceoughunhgtrghnsegsrgihnhgv rdhiugdrrghuqeenucggtffrrghtthgvrhhnpeefkeeugfethfegueevtdetvddthfelhe dvhfeiudektdefudejgeffheelgeduhfenucffohhmrghinhepsggrhihnvgdrihgurdgr uhenucfkphepuddutddrudejgedrudekfedruddufeenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpeguuhhntggrnhessggrhihnvgdrihgurdgr uh X-ME-Proxy: Original-Received: from duncan-w540 (110-174-183-113.tpgi.com.au [110.174.183.113]) by mail.messagingengine.com (Postfix) with ESMTPA id D026C1080059 for ; Thu, 7 Jan 2021 07:12:13 -0500 (EST) Received-SPF: pass client-ip=66.111.4.25; envelope-from=duncan@bayne.id.au; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:197474 Archived-At: 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.