This commit is contained in:
M66B 2020-11-16 20:12:40 +01:00
parent f0f14f66e4
commit 2680dc697a
1 changed files with 9 additions and 6 deletions

View File

@ -47,6 +47,8 @@ import androidx.preference.PreferenceManager;
import com.sun.mail.gimap.GmailFolder;
import com.sun.mail.gimap.GmailMessage;
import com.sun.mail.iap.BadCommandException;
import com.sun.mail.iap.CommandFailedException;
import com.sun.mail.iap.ConnectionException;
import com.sun.mail.iap.ProtocolException;
import com.sun.mail.iap.Response;
@ -464,12 +466,10 @@ class Core {
ex instanceof FileNotFoundException ||
ex instanceof FolderNotFoundException ||
ex instanceof IllegalArgumentException ||
(ex instanceof IllegalStateException &&
EntityOperation.SYNC.equals(op.name) &&
"This operation is not allowed on a closed folder".equals(ex.getMessage())) ||
ex instanceof SQLiteConstraintException ||
//ex.getCause() instanceof BadCommandException || // BAD
//ex.getCause() instanceof CommandFailedException || // NO
(!ConnectionHelper.isIoError(ex) &&
(ex.getCause() instanceof BadCommandException ||
ex.getCause() instanceof CommandFailedException /* NO */)) ||
MessageHelper.isRemoved(ex) ||
EntityOperation.ATTACHMENT.equals(op.name) ||
(ConnectionHelper.isIoError(ex) &&
@ -478,6 +478,7 @@ class Core {
// com.sun.mail.iap.BadCommandException: B13 BAD [TOOBIG] Message too large
// com.sun.mail.iap.CommandFailedException: AY3 NO [CANNOT] Cannot APPEND to a SPAM folder
// com.sun.mail.iap.CommandFailedException: B16 NO [ALERT] Cannot MOVE messages out of the Drafts folder
// com.sun.mail.iap.CommandFailedException: AV5 NO [OVERQUOTA] quota exceeded
// Drafts: javax.mail.FolderClosedException: * BYE Jakarta Mail Exception:
// javax.net.ssl.SSLException: Write error: ssl=0x8286cac0: I/O error during system call, Broken pipe
// Drafts: * BYE Jakarta Mail Exception: java.io.IOException: Connection dropped by server?
@ -486,7 +487,9 @@ class Core {
" folder=" + folder.id + ":" + folder.name +
" message=" + (message == null ? null : message.id + ":" + message.subject) +
" reason=" + Log.formatThrowable(ex, false));
if (op.tries > 1)
if (op.tries > 1 ||
ex.getCause() instanceof BadCommandException ||
ex.getCause() instanceof CommandFailedException)
Log.e(new Throwable(msg, ex));
try {