Gnus development mailing list
 help / color / mirror / Atom feed
From: dubach@dcepea.harvard.edu (Joev Dubach)
Subject: Re: NNTP authentification for Gnus -- how to?
Date: 07 Jan 1998 12:37:24 -0500	[thread overview]
Message-ID: <up67nw6v8r.fsf@dcepea.harvard.edu> (raw)
In-Reply-To: <vaf4t3g1fpe.fsf@petty.ls6.uni-do>

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"


      reply	other threads:[~1998-01-07 17:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-01-07 15:11 Kai Grossjohann
1998-01-07 17:37 ` Joev Dubach [this message]

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=up67nw6v8r.fsf@dcepea.harvard.edu \
    --to=dubach@dcepea.harvard.edu \
    /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).