Gnus development mailing list
 help / color / mirror / Atom feed
From: Michael Welsh Duggan <md5i@md5i.com>
To: ding@gnus.org
Subject: Dovecot and capabilities
Date: Mon, 21 Mar 2011 21:15:11 -0400	[thread overview]
Message-ID: <87ipvcymzk.fsf@maru.md5i.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

I was trying to figure out why, using my new Dovecot install, I was not
getting UIDPLUS or QRESYNC capabilities.  I found out that it was
because the capabilities were determined at connection time, and the set
of advertised capabilities changes between connection and login.  Upon
login on Dovecot, an updated set of capabilities may be advertised.  I
was able to account for that using the included patch.  A perhaps-better
method might be to re-run CAPABILITY after logging in.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0003-Allow-capabilities-to-be-set-after-login.patch --]
[-- Type: text/x-diff, Size: 1164 bytes --]

From f6dcf14c70aac1b1c240f0bae4174612b110cf1c Mon Sep 17 00:00:00 2001
From: Michael Welsh Duggan <md5i@md5i.com>
Date: Mon, 21 Mar 2011 21:09:34 -0400
Subject: [PATCH 3/3] Allow capabilities to be set after login

---
 lisp/nnimap.el |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 138875b..b92c4c8 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -395,7 +395,13 @@ textual parts.")
 		(let ((nnimap-inhibit-logging t))
 		  (setq login-result
 			(nnimap-login (car credentials) (cadr credentials))))
-		(unless (car login-result)
+		(if (car login-result)
+                    ;; See if capability is set as part of login
+                    ;; response
+                    (dolist (response (cddr login-result))
+                      (when (string= "CAPABILITY" (upcase (car response)))
+                        (setf (nnimap-capabilities nnimap-object)
+                              (mapcar #'upcase (cdr response)))))
 		  ;; If the login failed, then forget the credentials
 		  ;; that are now possibly cached.
 		  (dolist (host (list (nnoo-current-server 'nnimap)
-- 
1.7.4.1


[-- Attachment #3: Type: text/plain, Size: 42 bytes --]


-- 
Michael Welsh Duggan
(md5i@md5i.com)

             reply	other threads:[~2011-03-22  1:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22  1:15 Michael Welsh Duggan [this message]
2011-03-24 15:14 ` Ted Zlatanov
2011-03-29 18:18 ` Lars Magne Ingebrigtsen
2011-03-29 20:23   ` Michael Welsh Duggan
2011-03-29 20:27     ` Lars Magne Ingebrigtsen

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=87ipvcymzk.fsf@maru.md5i.com \
    --to=md5i@md5i.com \
    --cc=ding@gnus.org \
    /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).