Gnus development mailing list
 help / color / mirror / Atom feed
From: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
Subject: Re: Authinfo & multiple servers
Date: 22 May 1997 04:34:19 +0900	[thread overview]
Message-ID: <r9nraf01ux0.fsf@silicon.jaist.ac.jp> (raw)
In-Reply-To: Baba Z Buehler's message of Tue, 20 May 1997 16:44:28 -0500

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


  reply	other threads:[~1997-05-21 19:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-20 21:44 Baba Z Buehler
1997-05-21 19:34 ` Shuhei KOBAYASHI [this message]
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

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=r9nraf01ux0.fsf@silicon.jaist.ac.jp \
    --to=shuhei-k@jaist.ac.jp \
    /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).