GNU bug report logs - #12424
24.2; Gnus smtpmail not reprompting for failed password

Previous Next

Packages: gnus, emacs;

Reported by: Stephen Leake <stephen.a.leake <at> nasa.gov>

Date: Wed, 12 Sep 2012 15:53:02 UTC

Severity: normal

Tags: fixed

Found in version 24.2

Fixed in version 24.4

Done: Lars Ingebrigtsen <lars.magne.ingebrigtsen <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 12424 in the body.
You can then email your comments to 12424 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#12424; Package emacs. (Wed, 12 Sep 2012 15:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Leake <stephen.a.leake <at> nasa.gov>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 12 Sep 2012 15:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Stephen Leake <stephen.a.leake <at> nasa.gov>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.2; Gnus smtpmail not reprompting for failed password
Date: Wed, 12 Sep 2012 11:32:36 -0400
I have Gnus set up to get mail from an MS exchange server, using tls for
authentication.

Relevant settings:

(setq starttls-use-gnutls nil)
(setq starttls-extra-arguments nil)
(setq smtpmail-smtp-server "smtp02.ndc.nasa.gov")
(setq smtpmail-smtp-service 587)
(setq password-cache-expiry (* 24 3600)); only matters for tls

(setq smtpmail-starttls-credentials
      '(
        ("smtp02.ndc.nasa.gov" 587 nil nil)
        ))
(setq smtpmail-auth-credentials
      '(
        ;; The number of backslashes here seems to change from time to
        ;; time; experiment if it fails.
        ("smtp02.ndc.nasa.gov" 587 "ndc\\sleake" nil)
        ))


When first connecting, it prompts for my password. If I enter it
incorrectly, it never reprompts; I have to quit Emacs to get it to
reprompt.

I was unable to find the actual source of the problem; the smtp
authentication backends are a complicated system.
smtpmail-try-auth-methods does notice the failed login, and tries again
with ask-for-password t, but the backend does not respect that; it just
returns the bad cached password. I did not have the time to find out
which backend function is doing that.

One work-around is to set auth-source-do-cache nil, but then it prompts
all the time; the cache is nice to have.

Another work-around is to set password-cache nil; that forces a reprompt.

In GNU Emacs 24.2.1 (i686-pc-cygwin, GTK+ Version 2.24.11)
 of 2012-08-27 on fiona
Windowing system distributor `The Cygwin/X Project', version 11.0.11204000
Configured using:
 `configure
 '--srcdir=/home/kbrown/src/cygemacs/emacs-24.2-1/src/emacs-24.2'
 '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin'
 '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--datadir=/usr/share'
 '--localstatedir=/var' '--sysconfdir=/etc' '--datarootdir=/usr/share'
 '--docdir=/usr/share/doc/emacs' '-C' '--without-gsettings'
 '--without-gconf' 'CC=gcc' 'CFLAGS=-ggdb -O2 -pipe
 -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.2-1/build=/usr/src/debug/emacs-24.2-1
 -fdebug-prefix-map=/home/kbrown/src/cygemacs/emacs-24.2-1/src/emacs-24.2=/usr/src/debug/emacs-24.2-1'
 'LDFLAGS=-L/usr/lib/ncursesw' 'LIBS='
 'CPPFLAGS=-I/usr/include/ncursesw''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: C
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Message

Minor modes in effect:
  shell-dirtrack-mode: t
  gnus-message-citation-mode: t
  mml-mode: t
  display-time-mode: t
  delete-selection-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t

Recent input:
<return> M-x g <backspace> b u g <tab> <tab> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> r e p o <tab> r
<tab> <return>

Recent messages:
Sending via mail...
open-network-stream
Continue...
530 5.7.1 Client was not authenticated
334 VXNlcm5hbWU6
334 UGFzc3dvcmQ6
535 5.7.3 Authentication unsuccessful
221 2.0.0 Service closing transmission channel
smtpmail-send-it: Sending failed: 535 5.7.3 Authentication unsuccessful in response to OTZTYWxrYXRlLTY3
Making completion list... [2 times]

Load-path shadows:
/Projects/emacs_stephe.main/emacs_stephe_site_lisp/vc-git hides /usr/share/emacs/24.2/lisp/vc/vc-git
/Projects/emacs_stephe.main/emacs_stephe_site_lisp/ada-xref hides /usr/share/emacs/24.2/lisp/progmodes/ada-xref
/Projects/emacs_stephe.main/emacs_stephe_site_lisp/ada-stmt hides /usr/share/emacs/24.2/lisp/progmodes/ada-stmt
/Projects/emacs_stephe.main/emacs_stephe_site_lisp/ada-prj hides /usr/share/emacs/24.2/lisp/progmodes/ada-prj
/Projects/emacs_stephe.main/emacs_stephe_site_lisp/ada-mode hides /usr/share/emacs/24.2/lisp/progmodes/ada-mode
/Projects/emacs_stephe.main/emacs_stephe_site_lisp/nnnil hides /usr/share/emacs/24.2/lisp/gnus/nnnil

Features:
(shadow emacsbug debug copyright shell pcomplete cl-specs edebug
jka-compr find-func help-mode view misearch multi-isearch gnutls
network-stream starttls tls mailalias newcomment bbdb-gui smiley
gnus-cite qp mule-util parse-time sort gnus-async gnus-bcklg gnus-ml
disp-table utf-7 utf7 html2text bbdb-gnus bbdb-snarf mail-extr bbdb-com
bbdb-autoloads bbdb timezone imap nndraft nnmh nnml nnfolder nnnil
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 epg-config mm-view mml-smime smime dig mailcap nntp
gnus-cache gnus-sum nnoo gnus-group gnus-undo nnmail mail-source
gnus-start gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems smtpmail
auth-source eieio byte-opt bytecomp byte-compile cconv macroexp assoc
password-cache sendmail nnheader gnus-util message format-spec rfc822
mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils
mailheader uniquify advice help-fns advice-preload time delsel cus-start
cus-load ls-lisp color-theme edmacro kmacro wid-edit iswitchb whitespace
dired-x easymenu dired-aux dired compile comint regexp-opt ansi-color
ring cl time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel
x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs
button faces cus-face files text-properties overlay sha1 md5 base64
format env code-pages mule custom widget hashtable-print-readable
backquote make-network-process dbusbind dynamic-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

--
-- Stephe




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#12424; Package emacs,gnus. (Mon, 24 Dec 2012 11:29:01 GMT) Full text and rfc822 format available.

Message #8 received at 12424 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <lmi <at> gnus.org>
To: Stephen Leake <stephen.a.leake <at> nasa.gov>
Cc: 12424 <at> debbugs.gnu.org
Subject: Re: bug#12424: 24.2; Gnus smtpmail not reprompting for failed password
Date: Mon, 24 Dec 2012 12:27:30 +0100
Stephen Leake <stephen.a.leake <at> nasa.gov> writes:

> I have Gnus set up to get mail from an MS exchange server, using tls for
> authentication.
>
> Relevant settings:
>
> (setq starttls-use-gnutls nil)
> (setq starttls-extra-arguments nil)

If you have an Emacs 24 with built-in gnutls support, then these
variables aren't used.

> (setq smtpmail-starttls-credentials
>       '(
>         ("smtp02.ndc.nasa.gov" 587 nil nil)
>         ))
> (setq smtpmail-auth-credentials
>       '(
>         ;; The number of backslashes here seems to change from time to
>         ;; time; experiment if it fails.
>         ("smtp02.ndc.nasa.gov" 587 "ndc\\sleake" nil)
>         ))

These variables no longer exist in Emacs 24.

> When first connecting, it prompts for my password. If I enter it
> incorrectly, it never reprompts; I have to quit Emacs to get it to
> reprompt.

Looking at the code in smtpmail.el, it looks like it should only save
the password if the login was successful.  However, I don't have access
to any SMTP servers that require login, so I can't reproduce this.

I think.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#12424; Package emacs,gnus. (Mon, 24 Dec 2012 11:42:02 GMT) Full text and rfc822 format available.

Message #11 received at 12424 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stephen Leake <stephen.a.leake <at> nasa.gov>
Cc: 12424 <at> debbugs.gnu.org
Subject: Re: bug#12424: 24.2; Gnus smtpmail not reprompting for failed password
Date: Mon, 24 Dec 2012 12:40:33 +0100
Lars Magne Ingebrigtsen <lmi <at> gnus.org> writes:

> Looking at the code in smtpmail.el, it looks like it should only save
> the password if the login was successful.  However, I don't have access
> to any SMTP servers that require login, so I can't reproduce this.

Yes, I do.

The problem is this call that's done the second time with
`ask-for-password' set to t.  Then it will return the previous (wrong)
password for some reason or other...

(auth-source-search
 :host "smtp.gmail.com"
 :port "587"
 :user nil
 :max 1
 :require (and ask-for-password
	       '(:user :secret))
 :create ask-for-password)

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#12424; Package emacs,gnus. (Mon, 24 Dec 2012 12:16:01 GMT) Full text and rfc822 format available.

Message #14 received at 12424 <at> debbugs.gnu.org (full text, mbox):

From: Lars Magne Ingebrigtsen <lars.magne.ingebrigtsen <at> gmail.com>
To: Stephen Leake <stephen.a.leake <at> nasa.gov>
Cc: 12424 <at> debbugs.gnu.org
Subject: Re: bug#12424: 24.2; Gnus smtpmail not reprompting for failed password
Date: Mon, 24 Dec 2012 13:14:59 +0100
I've now fixed this bug on the Emacs trunk.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen




Added tag(s) fixed. Request was from Lars Ingebrigtsen <lars.magne.ingebrigtsen <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 24 Dec 2012 12:16:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 24.4, send any further explanations to 12424 <at> debbugs.gnu.org and Stephen Leake <stephen.a.leake <at> nasa.gov> Request was from Lars Ingebrigtsen <lars.magne.ingebrigtsen <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 24 Dec 2012 12:16:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 21 Jan 2013 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 4 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.