Gnus development mailing list
 help / color / mirror / Atom feed
* NNTP authentification for Gnus -- how to?
@ 1998-01-07 15:11 Kai Grossjohann
  1998-01-07 17:37 ` Joev Dubach
  0 siblings, 1 reply; 2+ messages in thread
From: Kai Grossjohann @ 1998-01-07 15:11 UTC (permalink / raw)
  Cc: Eik Hoffmann

I seem to be a bit stupid on how to do NNTP authentification for
Gnus.  Let's suppose my main NNTP server (i.e. gnus-select-method) is
a public news server that doesn't require user-id and password.  Let's
suppose further that I'd also like to have access to several NNTP
servers all requiring different user-ids and/or passwords.

It is surely possible to create a new server then edit it and use
server parameters for user id and password, but how?

tia,
kai
-- 
Kai Grossjohann, Informatik VI        grossjohann@ls6.cs.uni-dortmund.de
Uni Dortmund, D-44221 Dortmund        http://ls6-www.cs.uni-dortmund.de/
                                      Vox +49 231 755 5670, Fax -2405
I like both kinds of music.


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

* Re: NNTP authentification for Gnus -- how to?
  1998-01-07 15:11 NNTP authentification for Gnus -- how to? Kai Grossjohann
@ 1998-01-07 17:37 ` Joev Dubach
  0 siblings, 0 replies; 2+ messages in thread
From: Joev Dubach @ 1998-01-07 17:37 UTC (permalink / raw)


Kai Grossjohann <grossjohann@charly.cs.uni-dortmund.de> writes:

> I seem to be a bit stupid on how to do NNTP authentification for
> Gnus.  Let's suppose my main NNTP server (i.e. gnus-select-method) is
> a public news server that doesn't require user-id and password.  Let's
> suppose further that I'd also like to have access to several NNTP
> servers all requiring different user-ids and/or passwords.

In my experience this requires a bit of additional code to work properly:

---- authentication-handling from my .emacs-gnus begins ----
(require 'cl)

; "my-nntp-send-authinfo-from-file" was taken from sample code posted
; to the (ding) Gnus mailing list, and will hopefully be
; incorporated in a future version of Gnus.
(defvar my-nntp-authinfo-file "~/.my-nntp-authinfo"
  "Each line of `my-nntp-authinfo-file' should be of the form:

  `SERVER USER PASS'.")

(defun my-nntp-send-authinfo-from-file ()
  (when (file-exists-p my-nntp-authinfo-file)
    (nnheader-temp-write nil
      (insert-file-contents my-nntp-authinfo-file)
      (goto-char (point-min))
      (if (re-search-forward
           (format "^%s \\([^ \n]+\\) \\([^ \n]+\\)$"
                   nntp-address)
           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 'my-nntp-send-authinfo-from-file)
---- authentication-handling from my .emacs-gnus ends ----

---- .my-nntp-authinfo begins ----
server1 username1 password1
server2 username2 password2
---- .my-nntp-authinfo ends ----

Hope this helps.

Joev

  "'All my life,' said the manager, half to himself, 'I have wished to
   see not one Communist but ten close by, not two Nigerians but twenty
   in their skins, not three cowboy Americans but a gross fresh from the
   saddle.  So when six hothouse roses come in a bouquet, I could not
   resist potting them.  The Dublin winter is long, Meg; this may be the
   only lit fuse in the whole year.  Stand by for the lovely
   concussion.'"
          -- Ray Bradbury, "The Cold Wind and the Warm"


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

end of thread, other threads:[~1998-01-07 17:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-01-07 15:11 NNTP authentification for Gnus -- how to? Kai Grossjohann
1998-01-07 17:37 ` Joev Dubach

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