mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 11:42:16 -05:00
Tempfail outgoing messages after 5 delivery attempts
This commit is contained in:
parent
2affa9d52b
commit
a54cf7a757
@ -245,6 +245,13 @@ public class K9 extends Application {
|
||||
*/
|
||||
public static final int MAX_ATTACHMENT_DOWNLOAD_SIZE = (128 * 1024 * 1024);
|
||||
|
||||
|
||||
/* How many times should K-9 try to deliver a message before giving up
|
||||
* until the app is killed and restarted
|
||||
*/
|
||||
|
||||
public static int MAX_SEND_ATTEMPTS = 5;
|
||||
|
||||
/**
|
||||
* Max time (in millis) the wake lock will be held for when background sync is happening
|
||||
*/
|
||||
|
@ -3011,6 +3011,14 @@ public class MessagingController implements Runnable {
|
||||
if (K9.DEBUG)
|
||||
Log.i(K9.LOG_TAG, "Send count for message " + message.getUid() + " is " + count.get());
|
||||
|
||||
if (count.incrementAndGet() > K9.MAX_SEND_ATTEMPTS) {
|
||||
Log.e(K9.LOG_TAG, "Send count for message " + message.getUid() + " can't be delivered after "+ K9.MAX_SEND_ATTEMPTS + " attempts. Giving up until the user restarts the device");
|
||||
notifySendTempFailed(account, new MessagingException(message.getSubject()));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
localFolder.fetch(new Message[] { message }, fp, null);
|
||||
try {
|
||||
message.setFlag(Flag.X_SEND_IN_PROGRESS, true);
|
||||
|
Loading…
Reference in New Issue
Block a user