* Double the retry interval for SMTP deliveries after each failed attempt.
authorArt Cancro <ajc@citadel.org>
Mon, 15 May 2000 00:05:22 +0000 (00:05 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 15 May 2000 00:05:22 +0000 (00:05 +0000)
citadel/ChangeLog
citadel/serv_smtp.c
citadel/techdoc/delivery-list.txt

index 5b6eb1cab76c0456dfbca835fd613e1f16ccff79..1bd4ba8336b9ab84dd598d7ac8f4060c3f6fb8ea 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 571.6  2000/05/15 00:05:19  ajc
+ * Double the retry interval for SMTP deliveries after each failed attempt.
+
  Revision 571.5  2000/05/11 03:08:47  ajc
  * serv_smtp.c: clear the relevant state buffers after an SMTP DATA command
    completes, allowing multiple messages in one session.  Closes bug #58.
@@ -1872,4 +1875,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
-
index dc6c5174e84dc2d2e8b87b8ec00863bd643bed4b..3e8edcb342f878617eae034f49ca105461d72dee 100644 (file)
@@ -1258,6 +1258,7 @@ void smtp_do_procmsg(long msgnum) {
        int incomplete_deliveries_remaining;
        time_t attempted = 0L;
        time_t last_attempted = 0L;
+       time_t retry = SMTP_RETRY_INTERVAL;
 
        msg = CtdlFetchMessage(msgnum);
        if (msg == NULL) {
@@ -1288,6 +1289,11 @@ void smtp_do_procmsg(long msgnum) {
                if (!strcasecmp(key, "msgid")) {
                        text_msgid = extract_long(buf, 1);
                }
+               if (!strcasecmp(key, "retry")) {
+                       /* double the retry interval after each attempt */
+                       retry = extract_long(buf, 1) * 2L;
+                       remove_token(instr, i, '\n');
+               }
                if (!strcasecmp(key, "attempted")) {
                        attempted = extract_long(buf, 1);
                        if (attempted > last_attempted)
@@ -1299,7 +1305,7 @@ void smtp_do_procmsg(long msgnum) {
        /*
         * Postpone delivery if we've already tried recently.
         */
-       if ( (time(NULL) - last_attempted) < SMTP_RETRY_INTERVAL) {
+       if ( (time(NULL) - last_attempted) < retry) {
                lprintf(7, "Retry time not yet reached.\n");
                phree(instr);
                return;
@@ -1388,8 +1394,10 @@ void smtp_do_procmsg(long msgnum) {
                msg->cm_fields['M'] = malloc(strlen(instr)+256);
                snprintf(msg->cm_fields['M'],
                        strlen(instr)+256,
-                       "Content-type: %s\n\n%s\nattempted|%ld\n",
-                       SPOOLMIME, instr, time(NULL) );
+                       "Content-type: %s\n\n%s\n"
+                       "attempted|%ld\n"
+                       "retry|%ld\n",
+                       SPOOLMIME, instr, time(NULL), retry );
                phree(instr);
                CtdlSaveMsg(msg, "", SMTP_SPOOLOUT_ROOM, MES_LOCAL);
                CtdlFreeMessage(msg);
index b6c3880dd6fc503a69eab8acfedf087aed639f5a..ce90e765839fba870bb86b62f3f560da99f780fc 100644 (file)
@@ -47,6 +47,16 @@ each line.
     attempt.
  
  
+ INSTRUCTION:  retry
+ SYNTAX:       retry|9999999
+ DESCRIPTION:
+    Citadel does not retry SMTP delivery at a fixed interval.  Instead, it
+starts at a nominal interval (15 minutes by default) and then doubles the
+interval after each failed attempt.  This instruction contains the interval
+which should currently be followed (and doubled again, if the next delivery
+fails).
+  
+  
  INSTRUCTION:  bounceto
  SYNTAX:       bounceto|Big Bad Sender[@host]
  DESCRIPTION: