You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FairEmail/patches/JavaMail.patch

45 lines
1.8 KiB

diff --git a/app/src/main/java/com/sun/mail/imap/IMAPStore.java b/app/src/main/java/com/sun/mail/imap/IMAPStore.java
4 years ago
index 866f17737..929e82d33 100644
--- a/app/src/main/java/com/sun/mail/imap/IMAPStore.java
+++ b/app/src/main/java/com/sun/mail/imap/IMAPStore.java
4 years ago
@@ -1014,6 +1014,8 @@ public class IMAPStore extends Store
p.disconnect();
} catch (Exception ex2) { }
p = null;
4 years ago
+ eu.faircode.email.Log.e(new MessagingException("IMAP connection failure", ex1));
+ throw new MessagingException("connection failure", ex1);
}
if (p == null)
4 years ago
@@ -1529,6 +1531,30 @@ public class IMAPStore extends Store
}
}
+ public synchronized String getCapability(String capability)
+ throws MessagingException {
+ IMAPProtocol p = null;
+ try {
+ p = getStoreProtocol();
+ Map<String, String> caps = p.getCapabilities();
+ if (caps != null)
+ for (String cap : caps.values()) {
+ int eq = (cap == null ? -1 : cap.indexOf('='));
+ if (eq > 0) {
+ String key = cap.substring(0, eq);
+ String value = cap.substring(eq + 1);
+ if (capability.equals(key))
+ return value;
+ }
+ }
+ return null;
+ } catch (ProtocolException pex) {
+ throw new MessagingException(pex.getMessage(), pex);
+ } finally {
+ releaseStoreProtocol(p);
+ }
+ }
+
/**
* Set the user name to be used with the PROXYAUTH command.
* The PROXYAUTH user name can also be set using the