* Add the 34-manpage-defaults patch to properly document what dma will use
as default values if not specified in the config file instead of what
the default config file specifies. Closes: #544748
+ * Add the 35-delivery-retry patch to try local deliveries a bit more often
+ and to randomize the delivery timeout to avoid locking issues.
-- Peter Pentchev <roam@ringlet.net> Fri, 25 Jun 2010 12:02:22 +0300
--- /dev/null
+Description: Randomize the retry timeouts a bit.
+Origin: other: http://svn.ringlet.net/svn/ringlet/mail/dma/
+Forwarded: no
+Author: Peter Pentchev <roam@ringlet.net>
+Last-Update: 2010-06-28
+
+--- a/dma.c
++++ b/dma.c
+@@ -276,7 +276,7 @@
+ deliver(struct qitem *it)
+ {
+ int error;
+- unsigned int backoff = MIN_RETRY;
++ unsigned int backoff = it->remote? MIN_RETRY: MIN_RETRY_LOCAL;
+ const char *errmsg = "unknown bounce reason";
+ struct timeval now;
+ struct stat st;
+@@ -313,7 +313,13 @@
+ "delay cannot be interrupted");
+ sleep(backoff);
+ signal(SIGALRM, SIG_DFL);
+- backoff *= 2;
++ backoff = backoff * 2 + (
++#ifdef HAVE_RANDOM
++ random()
++#else
++ rand()
++#endif
++ % RETRY_JITTER);
+ if (backoff > MAX_RETRY)
+ backoff = MAX_RETRY;
+ goto retry;
+--- a/dma.h
++++ b/dma.h
+@@ -48,7 +48,9 @@
+
+ #define BUF_SIZE 2048
+ #define MIN_RETRY 300 /* 5 minutes */
++#define MIN_RETRY_LOCAL 30 /* 30 seconds */
+ #define MAX_RETRY (3*60*60) /* retry at least every 3 hours */
++#define RETRY_JITTER 10
+ #define MAX_TIMEOUT (5*24*60*60) /* give up after 5 days */
+ #ifndef PATH_MAX
+ #define PATH_MAX 1024 /* Max path len */