Skip to content

Commit

Permalink
Stop ImapFolderPusher on CertificateValidationException
Browse files Browse the repository at this point in the history
This is a permanent error, but apparently not treated as one. I got
a certificate error notification every two seconds just now (because
LocalKeyStore is broken, see thunderbird#3772). This PR simply stops the pusher on
a certificate error.
  • Loading branch information
Valodim committed Dec 1, 2018
1 parent bb6427c commit 268ccfc
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.Set;

import com.fsck.k9.mail.AuthenticationFailedException;
import com.fsck.k9.mail.CertificateValidationException;
import com.fsck.k9.mail.Flag;
import com.fsck.k9.mail.K9MailLib;
import com.fsck.k9.mail.Message;
Expand Down Expand Up @@ -194,6 +195,12 @@ public void run() {

pushReceiver.authenticationFailed();
stop = true;
} catch (CertificateValidationException e) {
reacquireWakeLockAndCleanUp();

Timber.e(e, "Certificate check failed. Stopping ImapFolderPusher.");
stop = true;
pushReceiver.pushError("Push error for " + getServerId(), e);
} catch (Exception e) {
reacquireWakeLockAndCleanUp();

Expand Down

0 comments on commit 268ccfc

Please sign in to comment.