On Fri, 10 May 2013 23:30:00 +0800 XeCycle <[email protected]> wrote: 

X> Some time ago I was told that upon connecting a NNTP server the
X> authinfo file is always read, so as not to miss any lines with
X> `force' for the server.  But it causes inconvenience when my
X> authinfo file is encrypted.

X> So I came again to ask, can I now inhibit reading of
X> authentication information for a specific server?  If not, I'm
X> seriously requesting this feature.  I do have some sort of GPG
X> agent running, but I think it better to give this option.

Hi Carl,

see the attached patch.  I am not sure if the parameter will be called
`nntp-auth' but please try applying the patch once and see if the logic
is correct.  Let me know if you're not sure how to use this.

Thanks
Ted

diff --git a/lisp/nntp.el b/lisp/nntp.el
index 58135a1..1a9cf55 100644
--- a/lisp/nntp.el
+++ b/lisp/nntp.el
@@ -258,6 +258,9 @@ to insert Cancel-Lock headers.")
 This is usually slower, but on misconfigured servers that don't
 update their active files often, this can help.")
 
+(defvoo nntp-auth t
+  "If nil, never try to authenticate NNTP.")
+
 ;;; Internal variables.
 
 (defvoo nntp-retrieval-in-progress nil)
@@ -1191,11 +1194,12 @@ If SEND-IF-FORCE, only send authinfo to the server if the
   (let* ((list (netrc-parse nntp-authinfo-file))
 	 (alist (netrc-machine list nntp-address "nntp"))
          (auth-info
-          (nth 0 (auth-source-search
-		  :max 1
-		  :host (list nntp-address (nnoo-current-server 'nntp))
-		  :port `("119" "nntp" ,(format "%s" nntp-port-number)
-			  "563" "nntps" "snews"))))
+          (when nntp-auth
+            (nth 0 (auth-source-search
+                    :max 1
+                    :host (list nntp-address (nnoo-current-server 'nntp))
+                    :port `("119" "nntp" ,(format "%s" nntp-port-number)
+                            "563" "nntps" "snews")))))
          (auth-user (plist-get auth-info :user))
          (auth-force (plist-get auth-info :force))
          (auth-passwd (plist-get auth-info :secret))
_______________________________________________
info-gnus-english mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to