mirror of
https://github.com/moparisthebest/k-9
synced 2024-12-25 00:58:50 -05:00
Permanent failures when trying to deliver a message move it back to
drafts. Opening a "permfail" message takes you to the drafts folder
This commit is contained in:
parent
d80a941dba
commit
2affa9d52b
@ -3045,6 +3045,15 @@ public class MessagingController implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
// 5.x.x errors from the SMTP server are "PERMFAIL"
|
||||||
|
// move the message over to drafts rather than leaving it in the outbox
|
||||||
|
// This is a complete hack, but is worlds better than the previous
|
||||||
|
// "don't even bother" functionality
|
||||||
|
if (getRootCauseMessage(e).startsWith("5")) {
|
||||||
|
localFolder.moveMessages(new Message[] { message }, (LocalFolder) localStore.getFolder(account.getDraftsFolderName()));
|
||||||
|
} else {
|
||||||
|
}
|
||||||
|
|
||||||
message.setFlag(Flag.X_SEND_FAILED, true);
|
message.setFlag(Flag.X_SEND_FAILED, true);
|
||||||
Log.e(K9.LOG_TAG, "Failed to send message", e);
|
Log.e(K9.LOG_TAG, "Failed to send message", e);
|
||||||
for (MessagingListener l : getListeners()) {
|
for (MessagingListener l : getListeners()) {
|
||||||
@ -3064,7 +3073,11 @@ public class MessagingController implements Runnable {
|
|||||||
l.sendPendingMessagesCompleted(account);
|
l.sendPendingMessagesCompleted(account);
|
||||||
}
|
}
|
||||||
if (lastFailure != null) {
|
if (lastFailure != null) {
|
||||||
notifySendFailed(account, lastFailure);
|
if (getRootCauseMessage(lastFailure).startsWith("5")) {
|
||||||
|
notifySendPermFailed(account, lastFailure);
|
||||||
|
} else {
|
||||||
|
notifySendTempFailed(account, lastFailure);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (UnavailableStorageException e) {
|
} catch (UnavailableStorageException e) {
|
||||||
Log.i(K9.LOG_TAG, "Failed to send pending messages because storage is not available - trying again later.");
|
Log.i(K9.LOG_TAG, "Failed to send pending messages because storage is not available - trying again later.");
|
||||||
|
Loading…
Reference in New Issue
Block a user