From: vitaly Date: Tue, 26 May 2009 14:22:09 +0000 (+0000) Subject: IMAP: fix bug with obtaining wrong capabilities from Zimbra server X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ac3785cf4e1a55feeebe0a1e4ba4211a7825c11;p=elisp%2Fwanderlust.git IMAP: fix bug with obtaining wrong capabilities from Zimbra server Zimbra IMAP server returns only few basic capabilities when client asks CAPABILITY before LOGIN. Wanderlust remembers first capabilities answer and, thus, can't use all extended features anymore. Fix it by asking for capabilities also after login. --- diff --git a/elmo/elmo-imap4.el b/elmo/elmo-imap4.el index c6fc344..7b2c66d 100644 --- a/elmo/elmo-imap4.el +++ b/elmo/elmo-imap4.el @@ -974,17 +974,25 @@ If CHOP-LENGTH is not specified, message set is not chopped." (when (elmo-imap4-session-capable-p session 'logindisabled) (signal 'elmo-authenticate-error '(elmo-imap4-clear-login))) (let ((elmo-imap4-debug-inhibit-logging t)) - (or - (elmo-imap4-read-ok - session - (elmo-imap4-send-command + (prog1 + (or + (elmo-imap4-read-ok + session + (elmo-imap4-send-command + session + (list "login " + (elmo-imap4-userid (elmo-network-session-user-internal session)) + " " + (elmo-imap4-password + (elmo-get-passwd (elmo-network-session-password-key session)))))) + (signal 'elmo-authenticate-error '(elmo-imap4-clear-login))) +;; Fix for Zimbra +;; Some servers return reduced capabilities when client asks for them before login + (elmo-imap4-session-set-capability-internal session - (list "login " - (elmo-imap4-userid (elmo-network-session-user-internal session)) - " " - (elmo-imap4-password - (elmo-get-passwd (elmo-network-session-password-key session)))))) - (signal 'elmo-authenticate-error '(elmo-imap4-clear-login))))) + (elmo-imap4-response-value + (elmo-imap4-send-command-wait session "capability") + 'capability))))) (defun elmo-imap4-auth-login (session) (let ((tag (elmo-imap4-send-command session "authenticate login"))