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) {