[gnus git] branch tzz-auth-source-rewrite updated: =1= * sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it.

Julien Danjou <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  36c0ef49e513e2e2318443b68257b5c71c2fe6a5 (commit)
      from  bb14e42650df76c01ba8ea09bc341e7abae239ba (commit)


- Log -----------------------------------------------------------------
commit 36c0ef49e513e2e2318443b68257b5c71c2fe6a5
Author: Ted Zlatanov <[email protected]>
Date:   Thu Feb 10 15:33:32 2011 -0600

    * sieve-manage.el: Autoload `auth-source-search'. (sieve-sasl-auth): Use it.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ec7910e..ab3d157 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-10  Teodor Zlatanov  <[email protected]>
+
+	* sieve-manage.el: Autoload `auth-source-search'.
+	(sieve-sasl-auth): Use it.
+
 2011-02-09  Teodor Zlatanov  <[email protected]>
 
 	* nnimap.el: Autoload `auth-source-forget+'.
diff --git a/lisp/sieve-manage.el b/lisp/sieve-manage.el
index d115f40..c9a0df2 100644
--- a/lisp/sieve-manage.el
+++ b/lisp/sieve-manage.el
@@ -83,7 +83,7 @@
   (require 'starttls))
 (autoload 'sasl-find-mechanism "sasl")
 (autoload 'starttls-open-stream "starttls")
-(autoload 'auth-source-user-or-password "auth-source")
+(autoload 'auth-source-search "auth-source")
 
 ;; User customizable variables:
 
@@ -273,16 +273,20 @@ Valid states are `closed', `initial', `nonauth', and `auth'.")
   "Login to server using the SASL MECH method."
   (message "sieve: Authenticating using %s..." mech)
   (with-current-buffer buffer
-    (let* ((user-password (auth-source-user-or-password
-                           '("login" "password")
-                           sieve-manage-server
-                           "sieve" nil t))
+    (let* ((auth-info (auth-source-search :host sieve-manage-server
+                                          :port "sieve"
+                                          :max 1))
+           (user-name (plist-get (nth 0 auth-info) :user))
+           (user-password (plist-get (nth 0 auth-info) :secret))
+           (user-password (if (functionp user-password)
+                              (funcall user-password)
+                            user-password))
            (client (sasl-make-client (sasl-find-mechanism (list mech))
-                                     (car user-password) "sieve" sieve-manage-server))
+                                     user-name "sieve" sieve-manage-server))
            (sasl-read-passphrase
             ;; We *need* to copy the password, because sasl will modify it
             ;; somehow.
-            `(lambda (prompt) ,(copy-sequence (cadr user-password))))
+            `(lambda (prompt) ,(copy-sequence user-password)))
            (step (sasl-next-step client nil))
            (tag (sieve-manage-send
                  (concat

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog       |    5 +++++
 lisp/sieve-manage.el |   18 +++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, tzz-auth-source-rewrite has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.