mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 19:34:15 +01:00
Sanitize read/write errors
This commit is contained in:
@@ -99,6 +99,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import javax.mail.FolderClosedException;
|
||||
import javax.mail.MessageRemovedException;
|
||||
import javax.mail.MessagingException;
|
||||
|
||||
import static android.os.Process.THREAD_PRIORITY_BACKGROUND;
|
||||
import static androidx.browser.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION;
|
||||
@@ -426,6 +427,13 @@ public class Helper {
|
||||
if (ex instanceof MessageRemovedException)
|
||||
return null;
|
||||
|
||||
if (ex instanceof MessagingException &&
|
||||
ex.getCause() instanceof ConnectionException &&
|
||||
ex.getCause().getMessage() != null &&
|
||||
(ex.getCause().getMessage().contains("Read error") ||
|
||||
ex.getCause().getMessage().contains("Write error")))
|
||||
return null;
|
||||
|
||||
if (ex instanceof IOException &&
|
||||
ex.getCause() instanceof MessageRemovedException)
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user