From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/76874 Path: news.gmane.org!not-for-mail From: Matt Lundin Newsgroups: gmane.emacs.gnus.general 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 Message-ID: <87mxlu22lr.fsf@fastmail.fm> References: <87sjvq127b.fsf@gmail.com> <878vxhmmvj.fsf@lifelogs.com> <87tyg53tju.fsf@gmail.com> <87ipwj4wu8.fsf@lifelogs.com> <87y65fn285.fsf@fastmail.fm> <8762sj4sir.fsf@lifelogs.com> <874o834g2q.fsf@fastmail.fm> <87k4gyj52q.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1297950581 14307 80.91.229.12 (17 Feb 2011 13:49:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Feb 2011 13:49:41 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M25212=ding+2Daccount=gmane.org@lists.math.uh.edu Thu Feb 17 14:49:34 2011 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pq4Eg-0004KR-3K for ding-account@gmane.org; Thu, 17 Feb 2011 14:49:34 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Pq4Ef-0006Q5-F3 for ding-account@gmane.org; Thu, 17 Feb 2011 07:49:33 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Pq4Ee-0006Q0-Bf for ding@lists.math.uh.edu; Thu, 17 Feb 2011 07:49:32 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1Pq4Ed-0001Ip-5E for ding@lists.math.uh.edu; Thu, 17 Feb 2011 07:49:32 -0600 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Pq4Ec-0003Ro-EL for ding@gnus.org; Thu, 17 Feb 2011 14:49:30 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pq4EZ-0004DU-8G for ding@gnus.org; Thu, 17 Feb 2011 14:49:27 +0100 Original-Received: from 67-197-63-212.rh2.dyn.cm.comporium.net ([67.197.63.212]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Feb 2011 14:49:27 +0100 Original-Received: from mdl by 67-197-63-212.rh2.dyn.cm.comporium.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 17 Feb 2011 14:49:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 95 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 67-197-63-212.rh2.dyn.cm.comporium.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:PriRDOt9gCOwQAue8GM84BL+vgs= X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:76874 Archived-At: Ted Zlatanov writes: > On Wed, 16 Feb 2011 20:15:09 -0500 Matt Lundin 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 #[... "J‡" [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 #[... "J‡" [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