X-Git-Url: https://git.hcoop.net/bpt/emacs.git/blobdiff_plain/a9faac5c6333bcbfb30a00debf3de7a44e430e49..ab422c4d6899b1442cb6954c1829c1fb656b006c:/lisp/gnus/sieve-manage.el diff --git a/lisp/gnus/sieve-manage.el b/lisp/gnus/sieve-manage.el index cfecab8993..22c1f7036b 100644 --- a/lisp/gnus/sieve-manage.el +++ b/lisp/gnus/sieve-manage.el @@ -1,7 +1,6 @@ -;;; sieve-manage.el --- Implementation of the managesive protocol in elisp +;;; sieve-manage.el --- Implementation of the managesieve protocol in elisp -;; Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -;; 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 2001-2013 Free Software Foundation, Inc. ;; Author: Simon Josefsson @@ -84,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: @@ -158,6 +157,7 @@ for doing the actual authentication." (defcustom sieve-manage-default-stream 'network "Default stream type to use for `sieve-manage'. Must be a name of a stream in `sieve-manage-stream-alist'." + :version "24.1" :type 'symbol :group 'sieve-manage) @@ -274,16 +274,21 @@ 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 + :create t)) + (user-name (or (plist-get (nth 0 auth-info) :user) "")) + (user-password (or (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