From 97c7bf1d655533d425be56b2de10f5defff4bca1 Mon Sep 17 00:00:00 2001 From: Daniel Applebaum Date: Sat, 27 Feb 2010 17:48:00 +0000 Subject: [PATCH] Hopeful (but untested code) to get updated capabilities after successful CRAM-MD5 authentication. --- src/com/fsck/k9/mail/store/ImapStore.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/com/fsck/k9/mail/store/ImapStore.java b/src/com/fsck/k9/mail/store/ImapStore.java index 9c4d1f34e..8ae9305ad 100644 --- a/src/com/fsck/k9/mail/store/ImapStore.java +++ b/src/com/fsck/k9/mail/store/ImapStore.java @@ -1951,6 +1951,16 @@ public class ImapStore extends Store if (mAuthType == AuthType.CRAM_MD5) { authCramMD5(); + // The authCramMD5 method on the previous line does not allow for handling updated capabilities + // sent by the server. So, to make sure we update to the post-authentication capability list + // we fetch the capabilities here. + Log.i(K9.LOG_TAG, "Updating capabilities after CRAM-MD5 authentication for " + getLogId()); + List responses = receiveCapabilities(executeSimpleCommand(COMMAND_CAPABILITY)); + if (responses.size() != 2) + { + throw new MessagingException("Invalid CAPABILITY response received"); + } + } else if (mAuthType == AuthType.PLAIN) {