Gnus development mailing list
 help / color / mirror / Atom feed
* Authinfo & multiple servers
@ 1997-05-20 21:44 Baba Z Buehler
  1997-05-21 19:34 ` Shuhei KOBAYASHI
  0 siblings, 1 reply; 11+ messages in thread
From: Baba Z Buehler @ 1997-05-20 21:44 UTC (permalink / raw)



I want to use multiple news servers, some of which require user/pass 
authentication.  Ideally, I'd like Gnus to automatically log me in
(or prompt) for the servers that require authentication, and just 
jump right in on the ones that don't.

>From reading nntp.el (5.4.53), it _appears_ that I should just be
able to put nntp-send-nosy-authinfo into nntp-authinfo-function.  
However, this does not appear to work.  When connecting, Gnus prompts
for the name/password, then proceeds to hang.

Putting nntp-send-nosy-authinfo into nntp-server-opened-hook works,
but then some of the servers that do not require authentication seem
to get confused when Gnus sends the blank AUTHINFO USER and AUTHINFO PASS
commands.

Any ideas from the Gnus gurus?

Thanks,
--
# Baba Z Buehler - 'Hackito Ergo Sum'
# Beckman Institute Systems Services, Urbana Illinois
#
#  "To vacillate or not to vacillate, that is the question ... or is it?"
#
# PGP public key on WWW homepage and key servers (key id: C13D8EE1)
# WWW: http://www.beckman.uiuc.edu/~baba/


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

* Re: Authinfo & multiple servers
  1997-05-20 21:44 Authinfo & multiple servers Baba Z Buehler
@ 1997-05-21 19:34 ` Shuhei KOBAYASHI
  1997-05-24 22:28   ` Joev Dubach
  0 siblings, 1 reply; 11+ messages in thread
From: Shuhei KOBAYASHI @ 1997-05-21 19:34 UTC (permalink / raw)


>>>>> In <199705202144.QAA26198@tigger.beckman.uiuc.edu>,
>>>>> Baba Z Buehler <baba@beckman.uiuc.edu> wrote:
> I want to use multiple news servers, some of which require user/pass 
> authentication.  Ideally, I'd like Gnus to automatically log me in
> (or prompt) for the servers that require authentication, and just 
> jump right in on the ones that don't.

  I'm using modified version of `nntp-send-authinfo-from-file' to
connect servers that require authentication.

(defvar nntp-authinfo-file "~/.nntp-authinfo"
  "Each line of `nntp-authinfo-file' should be of the form:

  `SERVER:PORT USER PASS'.")

(defun nntp-send-authinfo-from-file ()
  (when (file-exists-p nntp-authinfo-file)
    (nnheader-temp-write nil
      (insert-file-contents nntp-authinfo-file)
      (goto-char (point-min))
      (if (re-search-forward
	   (format "^%s:%s \\([^ \n]+\\) \\([^ \n]+\\)$"
		   nntp-address
		   (if (stringp nntp-port-number)
		       nntp-port-number
		     (int-to-string nntp-port-number)))
	   nil t nil)
	  (let ((user (match-string 1))
		(pass (match-string 2)))
	    (nntp-send-command "^.*\r?\n" "AUTHINFO USER" user)
	    (nntp-send-command "^.*\r?\n" "AUTHINFO PASS" pass))))))

(add-hook 'nntp-server-opened-hook 'nntp-send-authinfo-from-file)

-- 
Shuhei KOBAYASHI / <shuhei-k@jaist.ac.jp>


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

* Re: Authinfo & multiple servers
  1997-05-21 19:34 ` Shuhei KOBAYASHI
@ 1997-05-24 22:28   ` Joev Dubach
  1997-05-25 12:49     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 11+ messages in thread
From: Joev Dubach @ 1997-05-24 22:28 UTC (permalink / raw)


Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp> writes:

>   I'm using modified version of `nntp-send-authinfo-from-file' to
> connect servers that require authentication.
> (defvar nntp-authinfo-file "~/.nntp-authinfo"
>   "Each line of `nntp-authinfo-file' should be of the form:

>   `SERVER:PORT USER PASS'.")

> (defun nntp-send-authinfo-from-file ()
>   (when (file-exists-p nntp-authinfo-file)
[...]

I just tried using an authenticated server for the first time, and
boy, this (and the rest of the associated code in the cited message)
would have been useful to have around to begin with.  Lars, is there
any way you could set it up so that this (or something like it, maybe
without the ":PORT") was included in Gnus, and recommended as the best
way to set up foreign authenticated nntp servers?

Heck, if you used this code, nntp-send-authinfo-from-file could even
be added to the nntp-server-opened-hook by default, as its
absence/emptiness wouldn't hurt the startup process.  Right now,
trying to set up multiple servers (some with authinfo, some without)
is like pulling teeth.  Until I found Shuhei's post, at which point
things made more sense.

Joev                            <URL:http://www.fas.harvard.edu/~dubach1/>

  "It's the end of the sixth round and the server's on the ropes.  The
   ref's giving it the ten-count, but look!  It's staggered to its feet.
   It takes a hit, it's stumbling, it blocks and ducks left, jabs to the
   right and HOLY MOSES DID YOU SEE THAT HOOK yes, the server is back in
   fine form as the bell rings at the end of the sixth round, and the
   fighters are converging back to their corners.  We'll be right back."
          -- James Grimmelmann


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

* Re: Authinfo & multiple servers
  1997-05-24 22:28   ` Joev Dubach
@ 1997-05-25 12:49     ` Lars Magne Ingebrigtsen
  1997-05-27 12:21       ` Joev Dubach
                         ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-05-25 12:49 UTC (permalink / raw)


dubach1@fas.harvard.edu (Joev Dubach) writes:

> I just tried using an authenticated server for the first time, and
> boy, this (and the rest of the associated code in the cited message)
> would have been useful to have around to begin with.  Lars, is there
> any way you could set it up so that this (or something like it, maybe
> without the ":PORT") was included in Gnus, and recommended as the best
> way to set up foreign authenticated nntp servers?

I may include the code in Quassia Gnus.  However, the recommended way
to set these things up is to include `nntp-server-opened-hook' (with
the required value) in the virtual server definition.

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


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

* Re: Authinfo & multiple servers
  1997-05-25 12:49     ` Lars Magne Ingebrigtsen
@ 1997-05-27 12:21       ` Joev Dubach
  1997-05-27 17:42         ` Lars Magne Ingebrigtsen
  1997-05-27 18:47       ` anonymous
       [not found]       ` <uufg1v99kbk.fsf <19970527184739.27636.qmail@sunsite.auc.dk>
  2 siblings, 1 reply; 11+ messages in thread
From: Joev Dubach @ 1997-05-27 12:21 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> I may include the code in Quassia Gnus.  However, the recommended way
> to set these things up is to include `nntp-server-opened-hook' (with
> the required value) in the virtual server definition.

I don't think this works as well as Shuhei's way; could you explain
further?  Let's say I have three groups from server S1, with username
U1 and password P1, and four groups from server S2 with username U2
and password P2.  What is the recommended way of setting up Gnus to
cope with this?

Joev                            <URL:http://www.fas.harvard.edu/~dubach1/>

  "Let me introduce you to Shoe Theory.
   The purpose of a shoe is to separate your foot from the ground, and
   to make walking easier and/or less damaging to the feet.  This is the
   Fundamental Shoe Postulate, and is not arguable."
          -- David Fergemann


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

* Re: Authinfo & multiple servers
  1997-05-27 12:21       ` Joev Dubach
@ 1997-05-27 17:42         ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-05-27 17:42 UTC (permalink / raw)


dubach1@fas.harvard.edu (Joev Dubach) writes:

> Let's say I have three groups from server S1, with username U1 and
> password P1, and four groups from server S2 with username U2 and
> password P2.  What is the recommended way of setting up Gnus to cope
> with this?

You could just use `nntp-send-nosy-authinfo', but that would be
cheating.

The recommended way is to define `nntp-server-opened-hook' in each
virtual server to the function you wish to use for authenticalion on
that server.  So you simply write different functions for different
servers.

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


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

* Re: Authinfo & multiple servers
  1997-05-25 12:49     ` Lars Magne Ingebrigtsen
  1997-05-27 12:21       ` Joev Dubach
@ 1997-05-27 18:47       ` anonymous
       [not found]       ` <uufg1v99kbk.fsf <19970527184739.27636.qmail@sunsite.auc.dk>
  2 siblings, 0 replies; 11+ messages in thread
From: anonymous @ 1997-05-27 18:47 UTC (permalink / raw)


@login2.fas.harvard.edu> <m2enasbylj.fsf@proletcult.slip.ifi.uio.no>
From: dubach1@fas.harvard.edu (Joev Dubach)
Organization: Not likely.
Date: 27 May 1997 14:47:38 -0400
Message-ID: <uufvi44zr91.fsf@login4.fas.harvard.edu>
Lines: 23
X-Newsreader: Gnus v5.4.54/Emacs 19.34
Path: login4.fas.harvard.edu
NNTP-Posting-Host: login4.fas.harvard.edu

Lars Magne Ingebrigtsen <larsi@gnus.org> writes:

> The recommended way is to 
[... snip snip ...]
> simply write different functions for different servers.

Um, yes, well, I'm actually trying to encourage non-lisp-programmers
to use Gnus, and I feel pretty silly telling them this bit.  I really
think it's better to have one function that reads from a single
modifiable data file (as Shuhei's code does), rather than having to
write new code for every authenticated foreign server you decide to
read news on.

Joev                            <URL:http://www.fas.harvard.edu/~dubach1/>

  "'Family purity' is the corpus of laws relating to not having
   relations with women from the time they see blood until they immerse
   in a body of non-drawn water of at least 40 se'ah, unless it's a
   spring or stream.  Once the 40 se'ah are accumulated, drawn water may
   be added.  This is why religious dialogue only goes so far --
   Christians speak about theology and Jews talk about what happens if
   drawn water gets poured into a body of water accidentally."
          -- Jonathan Gruenhut


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

* Re: Authinfo & multiple servers
       [not found]       ` <uufg1v99kbk.fsf <19970527184739.27636.qmail@sunsite.auc.dk>
@ 1997-05-30 20:19         ` Lars Magne Ingebrigtsen
  1997-05-31  1:25           ` Joev Dubach
  0 siblings, 1 reply; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-05-30 20:19 UTC (permalink / raw)


anonymous@sunsite.auc.dk writes:

> Um, yes, well, I'm actually trying to encourage non-lisp-programmers
> to use Gnus, and I feel pretty silly telling them this bit.  I really
> think it's better to have one function that reads from a single
> modifiable data file (as Shuhei's code does), rather than having to
> write new code for every authenticated foreign server you decide to
> read news on.

Sure, that code was nice, but there are so many tweakable backend
settings that writing functions like that for them all is a rather
endless task.  So the canonical way to do those things is to modify
the virtual servers and write simple component functions.

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


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

* Re: Authinfo & multiple servers
  1997-05-30 20:19         ` Lars Magne Ingebrigtsen
@ 1997-05-31  1:25           ` Joev Dubach
  1997-05-31 11:44             ` Lars Magne Ingebrigtsen
  1997-06-02 15:49             ` Edward J. Sabol
  0 siblings, 2 replies; 11+ messages in thread
From: Joev Dubach @ 1997-05-31  1:25 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> Sure, that code was nice, but there are so many tweakable backend
> settings that writing functions like that for them all is a rather
> endless task.  So the canonical way to do those things is to modify
> the virtual servers and write simple component functions.

Usernames/passwords are a special case, however.  I want them to be on
disk, so that I don't have to reenter them every time I connect to a
password-protected nntp server.  Yet they can't go in my
..emacs/.gnus/.newsrc.eld, as I give these files away at a moment's
notice.  The only currently supported way of meeting these constraints
is to put them into ~/.nntp-authinfo and use
nntp-send-authinfo-from-file; however, this loses if I have more than
one server/account/password that I want to access.

Really, I think for this particular example, it's more appropriate to
have a general function that I can set globally or add to all the
appropriate servers' definitions as I like, than to have to write new
code for every new server.  Passwords are special.

Joev                            <URL:http://www.fas.harvard.edu/~dubach1/>

  "And what is the point of this gorilla analogy?  You should be afraid
   of really big gorillas, right?  They are powerful and potentially
   dangerous.  And when they are on fire, that would be far worse - I'd
   hate to be locked in a room with a big gorilla that was on fire.
   Crazed with pain, he would be a terrible hazard."
          -- Hal Finney


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

* Re: Authinfo & multiple servers
  1997-05-31  1:25           ` Joev Dubach
@ 1997-05-31 11:44             ` Lars Magne Ingebrigtsen
  1997-06-02 15:49             ` Edward J. Sabol
  1 sibling, 0 replies; 11+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-05-31 11:44 UTC (permalink / raw)


dubach1@fas.harvard.edu (Joev Dubach) writes:

> Usernames/passwords are a special case, however.  I want them to be on
> disk, so that I don't have to reenter them every time I connect to a
> password-protected nntp server.

I don't think that you should have to.  I think the code posted was
fine.  All I did was answer "what is the recommended way to do these
things", and the recommended way is to alter the virtual server
parameters.

You should, of course, do whatever is most convenient for you.

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


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

* Re: Authinfo & multiple servers
  1997-05-31  1:25           ` Joev Dubach
  1997-05-31 11:44             ` Lars Magne Ingebrigtsen
@ 1997-06-02 15:49             ` Edward J. Sabol
  1 sibling, 0 replies; 11+ messages in thread
From: Edward J. Sabol @ 1997-06-02 15:49 UTC (permalink / raw)


Excerpts from [emacs.ding]: (30-May-97) Re: Authinfo & multiple servers by Joev Dubach
> Really, I think for this particular example, it's more appropriate to
> have a general function that I can set globally or add to all the
> appropriate servers' definitions as I like, than to have to write new
> code for every new server.

I have to agree with Joev. We already have a nntp-send-authinfo-from-file
function. I think all Joev is asking is that it be replaced with Shuhei
Kobayashi's version. It's far more functional and eaiser to use for
neophytes. And I personally would call the fact that the current
nntp-send-authinfo-from-file doesn't work with multiple NNTP servers a bug.

Later,
Ed


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

end of thread, other threads:[~1997-06-02 15:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-20 21:44 Authinfo & multiple servers Baba Z Buehler
1997-05-21 19:34 ` Shuhei KOBAYASHI
1997-05-24 22:28   ` Joev Dubach
1997-05-25 12:49     ` Lars Magne Ingebrigtsen
1997-05-27 12:21       ` Joev Dubach
1997-05-27 17:42         ` Lars Magne Ingebrigtsen
1997-05-27 18:47       ` anonymous
     [not found]       ` <uufg1v99kbk.fsf <19970527184739.27636.qmail@sunsite.auc.dk>
1997-05-30 20:19         ` Lars Magne Ingebrigtsen
1997-05-31  1:25           ` Joev Dubach
1997-05-31 11:44             ` Lars Magne Ingebrigtsen
1997-06-02 15:49             ` Edward J. Sabol

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