1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-23 22:51:02 +00:00

Enable X-UIDONLY if available

This commit is contained in:
M66B 2022-01-28 18:08:38 +01:00
parent ecb614d42f
commit a26376eda5
2 changed files with 21 additions and 0 deletions

View file

@ -1652,6 +1652,18 @@ public class IMAPStore extends Store
}
}
public synchronized void enable(String capability) throws ProtocolException, StoreClosedException {
IMAPProtocol p = null;
try {
p = getStoreProtocol("enable(" + capability + ")");
p.enable(capability);
} catch (ConnectionException cex) {
throw new StoreClosedException(this, cex.getMessage());
} finally {
releaseStoreProtocol(p);
}
}
/**
* Set the user name to be used with the PROXYAUTH command.
* The PROXYAUTH user name can also be set using the

View file

@ -37,6 +37,7 @@ import androidx.annotation.NonNull;
import androidx.preference.PreferenceManager;
import com.sun.mail.gimap.GmailSSLProvider;
import com.sun.mail.iap.ProtocolException;
import com.sun.mail.imap.IMAPFolder;
import com.sun.mail.imap.IMAPStore;
import com.sun.mail.pop3.POP3Store;
@ -755,6 +756,14 @@ public class EmailService implements AutoCloseable {
throw ex;
}
// Verizon
if (istore.hasCapability("X-UIDONLY") && istore.hasCapability("ENABLE"))
try {
istore.enable("X-UIDONLY");
} catch (ProtocolException ex) {
Log.e(ex);
}
} else if ("smtp".equals(protocol) || "smtps".equals(protocol)) {
// https://tools.ietf.org/html/rfc5321#section-4.1.3
String hdomain = getDefaultEhlo();