help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

improving SMTP credential caching


From: Tom Roche
Subject: improving SMTP credential caching
Date: Fri, 22 Mar 2013 16:43:27 -0400
User-agent: GNU Emacs 24.2.50.1 (x86_64-pc-linux-gnu, GTK+ Version 2.20.1)

How to either

* cause emacs (or whatever dependency emacs is driving for SMTP mail)
  to not cache failed credentials?

* force reauthentication from smtpmail, without restarting emacs or
  waiting? I'd most appreciate something bindable to `C-u C-c C-c` or
  similar.

Why I ask:

I send email from a debian box

$ cat /etc/debian_version
wheezy/sid
$ uname -rv
3.2.0-4-amd64 #1 SMP Debian 3.2.32-1
$ gcc --version | head -n 1
gcc (Debian 4.6.3-1) 4.6.3

using GNU Emacs 24.2.50.1 (package=emacs-snapshot), smtpmail, TLS
(package=gnutls-bin et al), and .authinfo. If I `compose-mail` and
then `C-c C-c` (message-send-and-exit), one of 3 results follows, as
determined by 5 parameters. The parameters are

P0. t_0: time at which I started emacs.

P1. t_s: time of most recent successful TLS authentication.

P2. t_f: time of most recent TLS authentication failure (typically due
    to typing the wrong password at the prompt).

P3. t_c: duration of credential cache.

P4. t: time at which I attempt to send mail.

The results they determine are:

R0. If either

    t_s < t_0
    (t_s + t_c) < t
    (t_f + t_c) < t

    I get prompted for the password corresponding to the {server,
    account} matched from my .authinfo, and message send succeeds or
    fails on my typing.

R1. If all of

    t_f < t_s
    t_0 < t_s
    t < (t_s + t_c)

    I get no password prompt, and my message sends successfully.

R2. If all of

    t_s < t_f
    t_0 < t_f
    t < (t_f + t_c)

    I get no password prompt, but message send fails with error like

> smtpmail-send-it: Sending failed: 535 5.7.8 Error: authentication
> failed: authentication failure in response to AUTH PLAIN

My problem is R2: smtpmail, or some dependency, is caching
_failed_ credentials, which blocks sending email until either

- I restart emacs, thus making ((t_s < t_0) && (t_f < t_0))

- I wait until the failed credentials expire, thus making
  (t_f + t_c) < t

both of which are suboptimal. I would prefer either

+ to make emacs (or dependency) *not* cache failed credentials

+ to force reauthentication (e.g., via `C-u C-c C-c`)

+ something else short of restarting or waiting

How to do?

TIA, Tom Roche <Tom_Roche@pobox.com>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]