From: Art Cancro Date: Mon, 15 May 2000 00:05:22 +0000 (+0000) Subject: * Double the retry interval for SMTP deliveries after each failed attempt. X-Git-Tag: v7.86~7199 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=c973257088f5eff0a239c39bed343c3f5d271a5b * Double the retry interval for SMTP deliveries after each failed attempt. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 5b6eb1cab..1bd4ba833 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import - diff --git a/citadel/serv_smtp.c b/citadel/serv_smtp.c index dc6c5174e..3e8edcb34 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -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); diff --git a/citadel/techdoc/delivery-list.txt b/citadel/techdoc/delivery-list.txt index b6c3880dd..ce90e7658 100644 --- a/citadel/techdoc/delivery-list.txt +++ b/citadel/techdoc/delivery-list.txt @@ -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: