Gnus development mailing list
 help / color / mirror / Atom feed
* nnimap authentication prompts?
@ 2011-02-21 18:09 Simon Josefsson
  2011-02-21 18:39 ` Sivaram Neelakantan
  2011-02-21 23:34 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 13+ messages in thread
From: Simon Josefsson @ 2011-02-21 18:09 UTC (permalink / raw)
  To: ding

I am upgrading from a rather old Gnus release, and it works relatively
well so far after I removed all nnir hooks in ~/.emacs.  I have this
gnus-secondary-select-method:

 (nnimap "yxa"
	 (nnimap-stream starttls)
	 (nnimap-address "localhost")
	 (nnimap-server-port 1430))

and a line in ~/.authinfo for this:

machine localhost port 1430 login jas password foo

however when I start Gnus it asks me a series of questions that confuses
me.  The first one is hostname, and I can chose between yxa and
localhost, what does this mean?  The username and password prompts are
understandable (although shouldn't it read this from my .authinfo
file?).  The final prompt is for port and I cannot specify 1430, only
'143' and 'imap' are valid choices.  I just pressed enter and it worked
anyway.

Should I modify my gnus-secondary-select-method to avoid these prompts?
If so to what?

Thanks,
/Simon



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-21 18:09 nnimap authentication prompts? Simon Josefsson
@ 2011-02-21 18:39 ` Sivaram Neelakantan
  2011-02-21 20:46   ` Ted Zlatanov
  2011-02-21 23:34 ` Lars Ingebrigtsen
  1 sibling, 1 reply; 13+ messages in thread
From: Sivaram Neelakantan @ 2011-02-21 18:39 UTC (permalink / raw)
  To: ding

On Mon, Feb 21 2011,Simon Josefsson wrote:

> however when I start Gnus it asks me a series of questions that confuses
> me.  The first one is hostname, and I can chose between yxa and
> localhost, what does this mean?  The username and password prompts are
> understandable (although shouldn't it read this from my .authinfo
> file?).  The final prompt is for port and I cannot specify 1430, only
> '143' and 'imap' are valid choices.  I just pressed enter and it worked
> anyway.

Apparently a fix is to be incorporated to rectify this confusing
initial setup.  I believe you'd be asked only once for this and the
collected data is supposed to go into .authinfo.gpg file from where it
will be read the next time.

[...]

>


 sivaram
 -- 




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-21 18:39 ` Sivaram Neelakantan
@ 2011-02-21 20:46   ` Ted Zlatanov
  2011-02-21 21:39     ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Ted Zlatanov @ 2011-02-21 20:46 UTC (permalink / raw)
  To: ding

On Tue, 22 Feb 2011 00:09:19 +0530 Sivaram Neelakantan <nsivaram.net@gmail.com> wrote: 

SN> On Mon, Feb 21 2011,Simon Josefsson wrote:
>> however when I start Gnus it asks me a series of questions that confuses
>> me.  The first one is hostname, and I can chose between yxa and
>> localhost, what does this mean?  The username and password prompts are
>> understandable (although shouldn't it read this from my .authinfo
>> file?).  The final prompt is for port and I cannot specify 1430, only
>> '143' and 'imap' are valid choices.  I just pressed enter and it worked
>> anyway.

SN> Apparently a fix is to be incorporated to rectify this confusing
SN> initial setup.  I believe you'd be asked only once for this and the
SN> collected data is supposed to go into .authinfo.gpg file from where it
SN> will be read the next time.

Yeah, and to reply to all the other issues with auth-source: yes, I know
it's annoying; I will get the prompts and the decoding issues fixed ASAP.
Unfortunately this weekend I didn't get a chance to work on it as I hoped.

Thanks
Ted




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-21 20:46   ` Ted Zlatanov
@ 2011-02-21 21:39     ` Simon Josefsson
  2011-02-21 21:43       ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2011-02-21 21:39 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Tue, 22 Feb 2011 00:09:19 +0530 Sivaram Neelakantan
> <nsivaram.net@gmail.com> wrote:
>
> SN> On Mon, Feb 21 2011,Simon Josefsson wrote:
>>> however when I start Gnus it asks me a series of questions that confuses
>>> me.  The first one is hostname, and I can chose between yxa and
>>> localhost, what does this mean?  The username and password prompts are
>>> understandable (although shouldn't it read this from my .authinfo
>>> file?).  The final prompt is for port and I cannot specify 1430, only
>>> '143' and 'imap' are valid choices.  I just pressed enter and it worked
>>> anyway.
>
> SN> Apparently a fix is to be incorporated to rectify this confusing
> SN> initial setup.  I believe you'd be asked only once for this and the
> SN> collected data is supposed to go into .authinfo.gpg file from where it
> SN> will be read the next time.
>
> Yeah, and to reply to all the other issues with auth-source: yes, I know
> it's annoying; I will get the prompts and the decoding issues fixed ASAP.
> Unfortunately this weekend I didn't get a chance to work on it as I hoped.

I have saved the authinfo once, and it now works every time.  My
~/.authinfo.gpg contains (decrypted):

machine "localhost" login "jas" password "foo"

which seems bad since it should have said port 1430 as well, though?
Fortunately I don't have multiple servers on localhost right now, but I
could have.

I'll try if adding a 'port 1430' will still works.

/Simon



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-21 21:39     ` Simon Josefsson
@ 2011-02-21 21:43       ` Simon Josefsson
  2011-02-22 22:09         ` Ted Zlatanov
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2011-02-21 21:43 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Simon Josefsson <simon@josefsson.org> writes:

> I have saved the authinfo once, and it now works every time.  My
> ~/.authinfo.gpg contains (decrypted):
>
> machine "localhost" login "jas" password "foo"
>
> which seems bad since it should have said port 1430 as well, though?
> Fortunately I don't have multiple servers on localhost right now, but I
> could have.
>
> I'll try if adding a 'port 1430' will still works.

Nope -- on startup then it runs the hostname/username/port/password
prompt cycle on me (with no possibility to enter 1430 as the port), and
it will add the line above to ~/.authinfo.gpg again.

/Simon



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-21 18:09 nnimap authentication prompts? Simon Josefsson
  2011-02-21 18:39 ` Sivaram Neelakantan
@ 2011-02-21 23:34 ` Lars Ingebrigtsen
  2011-02-22  8:50   ` Simon Josefsson
  1 sibling, 1 reply; 13+ messages in thread
From: Lars Ingebrigtsen @ 2011-02-21 23:34 UTC (permalink / raw)
  To: ding

Simon Josefsson <simon@josefsson.org> writes:

> I am upgrading from a rather old Gnus release, and it works relatively
> well so far after I removed all nnir hooks in ~/.emacs.  I have this
> gnus-secondary-select-method:
>
>  (nnimap "yxa"
> 	 (nnimap-stream starttls)
> 	 (nnimap-address "localhost")
> 	 (nnimap-server-port 1430))
>
> and a line in ~/.authinfo for this:
>
> machine localhost port 1430 login jas password foo

Hm...  hm...  Oh, it could possibly be a type issue?  If you change that
to the string "1430", does it work then?

If so, this is the culprit:

      (when nnimap-server-port
	(setq ports (append ports (list nnimap-server-port))))

auth-source expects strings, I think, so that should then be

(list (format "%s" nnimap-server-port))

I'll fix that.
        
-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-21 23:34 ` Lars Ingebrigtsen
@ 2011-02-22  8:50   ` Simon Josefsson
  2011-02-22 22:08     ` Ted Zlatanov
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2011-02-22  8:50 UTC (permalink / raw)
  To: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Simon Josefsson <simon@josefsson.org> writes:
>
>> I am upgrading from a rather old Gnus release, and it works relatively
>> well so far after I removed all nnir hooks in ~/.emacs.  I have this
>> gnus-secondary-select-method:
>>
>>  (nnimap "yxa"
>> 	 (nnimap-stream starttls)
>> 	 (nnimap-address "localhost")
>> 	 (nnimap-server-port 1430))
>>
>> and a line in ~/.authinfo for this:
>>
>> machine localhost port 1430 login jas password foo
>
> Hm...  hm...  Oh, it could possibly be a type issue?  If you change that
> to the string "1430", does it work then?

Nope, I tried that too in a later followup.  If I have

machine localhost port "1430" login jas password foo

it would query me for hostname, port, username and password again and
offer to save it (in ~/.authinfo.gpg) as:

machine localhost login jas password foo

so it seems the code is forgetting that the server is on a non-default
port.

Btw, shouldn't all auto-added stanzas to ~/.authinfo* use "port"?  Just
because you are saving a password for say port 143 doesn't mean you have
the same password (or even username) for port 587.

/Simon



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-22  8:50   ` Simon Josefsson
@ 2011-02-22 22:08     ` Ted Zlatanov
  2011-02-23 13:41       ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Ted Zlatanov @ 2011-02-22 22:08 UTC (permalink / raw)
  To: ding

On Tue, 22 Feb 2011 09:50:52 +0100 Simon Josefsson <simon@josefsson.org> wrote: 

SJ> Btw, shouldn't all auto-added stanzas to ~/.authinfo* use "port"?  Just
SJ> because you are saving a password for say port 143 doesn't mean you have
SJ> the same password (or even username) for port 587.

If the query had it, yes.  Otherwise no.  So:

;; no port in the saved line
(auth-source-search :host "nonesuch" :max 1 :create t)

;; port 143 in the saved line
(auth-source-search :host "nonesuch" :port 143 :max 1 :create t)

;; port 143 in the saved line
(auth-source-search :host "nonesuch" :port '(143 "imap") :max 1 :create t)

This is the case as of today's checkins.  Note you have the chance to
review and edit the line with `e' at the save prompt.

Ted




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-21 21:43       ` Simon Josefsson
@ 2011-02-22 22:09         ` Ted Zlatanov
  2011-02-23 13:39           ` Simon Josefsson
  0 siblings, 1 reply; 13+ messages in thread
From: Ted Zlatanov @ 2011-02-22 22:09 UTC (permalink / raw)
  To: ding

On Mon, 21 Feb 2011 22:43:04 +0100 Simon Josefsson <simon@josefsson.org> wrote: 

SJ> Simon Josefsson <simon@josefsson.org> writes:
>> I have saved the authinfo once, and it now works every time.  My
>> ~/.authinfo.gpg contains (decrypted):
>> 
>> machine "localhost" login "jas" password "foo"
>> 
>> which seems bad since it should have said port 1430 as well, though?
>> Fortunately I don't have multiple servers on localhost right now, but I
>> could have.
>> 
>> I'll try if adding a 'port 1430' will still works.

SJ> Nope -- on startup then it runs the hostname/username/port/password
SJ> prompt cycle on me (with no possibility to enter 1430 as the port), and
SJ> it will add the line above to ~/.authinfo.gpg again.

Can you try this with my recent changes?  Sorry for the trouble.

Thanks
Ted




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-22 22:09         ` Ted Zlatanov
@ 2011-02-23 13:39           ` Simon Josefsson
  2011-02-23 14:30             ` Ted Zlatanov
  0 siblings, 1 reply; 13+ messages in thread
From: Simon Josefsson @ 2011-02-23 13:39 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> Can you try this with my recent changes?  Sorry for the trouble.

Now I get an error about unknown function 'read-char-choice'.  I'm using
Emacs 23.

/Simon



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-22 22:08     ` Ted Zlatanov
@ 2011-02-23 13:41       ` Simon Josefsson
  0 siblings, 0 replies; 13+ messages in thread
From: Simon Josefsson @ 2011-02-23 13:41 UTC (permalink / raw)
  To: Ted Zlatanov; +Cc: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Tue, 22 Feb 2011 09:50:52 +0100 Simon Josefsson <simon@josefsson.org> wrote: 
>
> SJ> Btw, shouldn't all auto-added stanzas to ~/.authinfo* use "port"?  Just
> SJ> because you are saving a password for say port 143 doesn't mean you have
> SJ> the same password (or even username) for port 587.
>
> If the query had it, yes.  Otherwise no.

Why?  Gnus knows the port since I specified it in my configuration.
Maybe this has been fixed already, I'll try again when the
read-char-choice problem is resolved.

Thanks,
/Simon



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-23 13:39           ` Simon Josefsson
@ 2011-02-23 14:30             ` Ted Zlatanov
  2011-02-23 23:30               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 13+ messages in thread
From: Ted Zlatanov @ 2011-02-23 14:30 UTC (permalink / raw)
  To: ding

On Wed, 23 Feb 2011 14:39:40 +0100 Simon Josefsson <simon@josefsson.org> wrote: 

SJ> Ted Zlatanov <tzz@lifelogs.com> writes:
>> Can you try this with my recent changes?  Sorry for the trouble.

SJ> Now I get an error about unknown function 'read-char-choice'.  I'm using
SJ> Emacs 23.

Fixed to use read-char.

On Wed, 23 Feb 2011 14:41:17 +0100 Simon Josefsson <simon@josefsson.org> wrote: 

SJ> Ted Zlatanov <tzz@lifelogs.com> writes:

>> On Tue, 22 Feb 2011 09:50:52 +0100 Simon Josefsson <simon@josefsson.org> wrote: 
>> 
SJ> Btw, shouldn't all auto-added stanzas to ~/.authinfo* use "port"?  Just
SJ> because you are saving a password for say port 143 doesn't mean you have
SJ> the same password (or even username) for port 587.
>> 
>> If the query had it, yes.  Otherwise no.

SJ> Why?  Gnus knows the port since I specified it in my configuration.
SJ> Maybe this has been fixed already, I'll try again when the
SJ> read-char-choice problem is resolved.

nnimap's `auth-source-search' query will have the port you specified, so
things will work as you expect.  My point is that auth-source.el doesn't
know the right port and has to guess it.  The port comes either from the
query or from `auth-source-creation-defaults'.  The *only* guessed
parameter inside auth-source.el is the user name, and I actually think
that's also questionable.

Ted




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: nnimap authentication prompts?
  2011-02-23 14:30             ` Ted Zlatanov
@ 2011-02-23 23:30               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 13+ messages in thread
From: Lars Ingebrigtsen @ 2011-02-23 23:30 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> nnimap's `auth-source-search' query will have the port you specified, so
> things will work as you expect.  My point is that auth-source.el doesn't
> know the right port and has to guess it.

auth-source doesn't have to guess, though.  The caller says what port to
use by having the preferred port first in the list of ports.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-02-23 23:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-21 18:09 nnimap authentication prompts? Simon Josefsson
2011-02-21 18:39 ` Sivaram Neelakantan
2011-02-21 20:46   ` Ted Zlatanov
2011-02-21 21:39     ` Simon Josefsson
2011-02-21 21:43       ` Simon Josefsson
2011-02-22 22:09         ` Ted Zlatanov
2011-02-23 13:39           ` Simon Josefsson
2011-02-23 14:30             ` Ted Zlatanov
2011-02-23 23:30               ` Lars Ingebrigtsen
2011-02-21 23:34 ` Lars Ingebrigtsen
2011-02-22  8:50   ` Simon Josefsson
2011-02-22 22:08     ` Ted Zlatanov
2011-02-23 13:41       ` Simon Josefsson

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).