Gnus development mailing list
 help / color / mirror / Atom feed
From: Matt Lundin <mdl@imapmail.org>
To: ding@gnus.org
Subject: Re: Making Gnus ask my IMAP username and password after the recent auth-source changes
Date: Thu, 17 Feb 2011 08:49:04 -0500	[thread overview]
Message-ID: <87mxlu22lr.fsf@fastmail.fm> (raw)
In-Reply-To: <87k4gyj52q.fsf@lifelogs.com>

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Wed, 16 Feb 2011 20:15:09 -0500 Matt Lundin <mdl@imapmail.org> wrote: 
>
> ML> From .authinfo:
> ML> machine imap.gmail.com login [username] password [password]
>
> ML> And from the *Messages* buffer:
> ML> Opening connection to imap.gmail.com via tls...
> ML> Opening TLS connection to `imap.gmail.com'...
> ML> Opening TLS connection with `gnutls-cli --insecure -p imaps
> ML> imap.gmail.com'...done
> ML> Opening TLS connection to `imap.gmail.com'...done
> ML> auth-source-search: found 2 backends matching (:max 1 :host
> ML> ("gmail" "imap.gmail.com") :port ("143" "993" "imap" "imaps")
> ML> :create t)
> ML> Quit trying to open server nnimap+gmail
> ML> Couldn't open nnimap:gmail
>
> ML> Note: I pressed C-g to exit the user/protocol prompt. (Hence the "Quit
> ML> trying to open").
>
> Because you didn't go through the prompts, I don't know the actual
> backend that was used (see the second message below).

Thanks for answering

O.K., I went through the prompts. It looks as if auth-source-search
didn't find the relevant entry in ~/.authinfo. Instead, it grabbed the
new values entered at the prompt. Moreover, despite the fact that the
same values are present in .authinfo, auth-source asks whether I want to
create a new, encrypted authinfo.gpg.

--8<---------------cut here---------------start------------->8---
auth-source-search: found 2 backends matching (:max 1 :host ("gmail" "imap.gmail.com") :port ("143" "993" "imap" "imaps") :create t)
Add to file ~/.authinfo.gpg: line [machine "gmail" login "user"](y or n) 
auth-source-search: found 1 results (max 1/0) in [object auth-source-backend "~/.authinfo.gpg" netrc "~/.authinfo.gpg" t t t auth-source-netrc-create auth-source-netrc-search] matching (:max 1 :host ("gmail" "imap.gmail.com") :port ("143" "993" "imap" "imaps") :create t)
--8<---------------cut here---------------end--------------->8---

> I made a .authinfo.gpg file to test this with this first line:
>
> machine imap.gmail.com login x password y
>
> (auth-source-search :max 1 :host '("gmail" "imap.gmail.com") :port
> ("143" "993" "imap" "imaps") :create t)

O.K., I created an ~/.authinfo file (not .authinfo.gpg) with the values
above.

> And then did 
> (auth-source-search :max 1 :host '("gmail" "imap.gmail.com") :port
> ("143" "993" "imap" "imaps") :create t)

When evaluating the above, auth-source-search does not find the values
in .authinfo and instead prompts for for user name, protocol, and
password. (Note the "Add to file line" below.)

--8<---------------cut here---------------start------------->8---
auth-source-search: found 2 backends matching (:max 1 :host ("gmail" "imap.gmail.com") :port ("143" "993" "imap" "imaps") :create t)
Add to file ~/.authinfo.gpg: line [machine "gmail" login "user"](y or n) 
auth-source-search: found 1 results (max 1/0) in [object auth-source-backend "~/.authinfo.gpg" netrc "~/.authinfo.gpg" t t t auth-source-netrc-create auth-source-netrc-search] matching (:max 1 :host ("gmail" "imap.gmail.com") :port ("143" "993" "imap" "imaps") :create t)
((:host "gmail" :user "user" :protocol "" :secret (lambda (&rest
--cl-rest--) (apply #[... "\bJ‡" [G94901] 1] ... --cl-rest--))))
--8<---------------cut here---------------end--------------->8---

When I create an ~/authinfo.gpg file with exactly the same line,
everything seems to work. I.e., I get the same results as yours below.

> I see in *Messages*:
> auth-source-search: found 1 backends matching (:max 1 :host ("gmail"
> "imap.gmail.com") :port ("143" "993" "imap" "imaps") :create t)
> auth-source-search: found 1 results (max 1/0) in [object
> auth-source-backend "~/.authinfo.gpg" netrc "~/.authinfo.gpg" t t t
> auth-source-netrc-create auth-source-netrc-search] matching (:max 1
> :host ("gmail" "imap.gmail.com") :port ("143" "993" "imap" "imaps")
> :create t)
> ((:host "imap.gmail.com" :user "x" :secret (lambda (&rest --cl-rest--)
> (apply #[... "\bJ‡" [G19000] 1] ... --cl-rest--))))

In short, auth-source-search finds the correct values in authinfo.gpg
but does not find them in an unencrypted authinfo file with identical
lines. (Note, when running the tests, I deleted .authinfo when trying
.authinfo.gpg and vice versa.)

The value of auth-sources is ("~/.authinfo.gpg" "~/.authinfo").

BTW, authentication with an unencrypted .authinfo file works for nntp.

On a related note, I would gladly switch to .authinfo.gpp, except that I
find I am asked for my encryption password three times during startup:
once for imap and once for each nntp server.

Thanks,
Matt





  reply	other threads:[~2011-02-17 13:49 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15  2:06 Raphael Kubo da Costa
2011-02-15 13:46 ` Ted Zlatanov
2011-02-15 20:57   ` Raphael Kubo da Costa
2011-02-16 19:13     ` Ted Zlatanov
2011-02-16 20:39       ` Matt Lundin
2011-02-16 20:46         ` Ted Zlatanov
2011-02-17  1:15           ` Matt Lundin
2011-02-17 11:03             ` Ted Zlatanov
2011-02-17 13:49               ` Matt Lundin [this message]
2011-02-17 14:20                 ` Matt Lundin
2011-02-17 15:22                   ` Steinar Bang
2011-02-18 20:21                     ` Ted Zlatanov
2011-02-21 19:40                       ` Steinar Bang
2011-02-17  3:34       ` Raphael Kubo da Costa
2011-02-17 11:44         ` Ted Zlatanov
2011-02-17 13:34           ` Raphael Kubo da Costa
2011-02-17 14:16             ` Ted Zlatanov
2011-02-17 23:54               ` Lars Ingebrigtsen
2011-02-18 20:19                 ` Ted Zlatanov
2011-02-18 23:10                   ` Lars Ingebrigtsen
2011-02-22 21:52                     ` Ted Zlatanov
2011-02-23  8:52                       ` Lars Ingebrigtsen
2011-02-23 14:47                         ` Ted Zlatanov
2011-02-23 17:00                           ` Raphael Kubo da Costa
2011-02-23 17:09                             ` Ted Zlatanov
2011-02-23 17:56                               ` Raphael Kubo da Costa
2011-02-23 18:56                                 ` Ted Zlatanov
2011-02-25  4:42                                   ` Lars Ingebrigtsen
2011-02-25 11:31                                     ` Ted Zlatanov
2011-03-05 12:15                                       ` Lars Magne Ingebrigtsen
2011-03-08 18:26                                         ` Ted Zlatanov
2011-03-15 16:28                                           ` Lars Magne Ingebrigtsen
2011-03-15 16:43                                             ` Ted Zlatanov
2011-02-23 23:35                           ` Lars Ingebrigtsen
2011-02-23 23:36                           ` Lars Ingebrigtsen
2011-02-24  5:43                             ` Ted Zlatanov
2011-02-24 11:35                               ` Lars Ingebrigtsen
2011-02-24 13:06                                 ` Ted Zlatanov
2011-02-24 13:48                                   ` Raphael Kubo da Costa
2011-02-24 16:42                                   ` Ted Zlatanov
2011-02-25  4:47                                     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxlu22lr.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).