From 3e3bbb6767691506b964af8a45dba2ff09f9e6ee Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Sun, 16 Sep 2001 05:44:52 +0000 Subject: [PATCH] * serv_smtp.c: instead of doubling delivery retry times unbounded, set a maximum retry time of SMTP_RETRY_MAX (currently set to 12 hours) --- citadel/ChangeLog | 5 +++++ citadel/serv_smtp.c | 3 +++ citadel/sysconfig.h | 13 ++++++++++--- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 329542eac..663d75a1c 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 580.42 2001/09/16 05:44:51 ajc + * serv_smtp.c: instead of doubling delivery retry times unbounded, set a + maximum retry time of SMTP_RETRY_MAX (currently set to 12 hours) + Revision 580.41 2001/09/09 16:19:29 error * Updated PAM configuration file citadel.pam for Red Hat 7.x. @@ -2741,3 +2745,4 @@ 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 f10de741f..7cd291824 100644 --- a/citadel/serv_smtp.c +++ b/citadel/serv_smtp.c @@ -1314,6 +1314,9 @@ void smtp_do_procmsg(long msgnum, void *userdata) { if (!strcasecmp(key, "retry")) { /* double the retry interval after each attempt */ retry = extract_long(buf, 1) * 2L; + if (retry > SMTP_RETRY_MAX) { + retry = SMTP_RETRY_MAX; + } remove_token(instr, i, '\n'); } if (!strcasecmp(key, "attempted")) { diff --git a/citadel/sysconfig.h b/citadel/sysconfig.h index 745f9ca7e..312b1f93a 100644 --- a/citadel/sysconfig.h +++ b/citadel/sysconfig.h @@ -79,10 +79,17 @@ #define SIZ 4096 /* - * SMTP delivery retry and give-up times + * SMTP delivery retry rules (all values are in seconds) + * + * If delivery of a message via SMTP is unsuccessful, Citadel will try again + * after SMTP_RETRY_INTERVAL seconds. This interval will double after each + * unsuccessful delivery, up to a maximum of SMTP_RETRY_MAX seconds. If no + * successful delivery has been accomplished after SMTP_GIVE_UP seconds, the + * message will be returned to its sender. */ -#define SMTP_RETRY_INTERVAL 900 /* retry sends every 15 minutes */ -#define SMTP_GIVE_UP 432000 /* give up after 5 days */ +#define SMTP_RETRY_INTERVAL 900 /* 15 minutes */ +#define SMTP_RETRY_MAX 43200 /* 12 hours */ +#define SMTP_GIVE_UP 432000 /* 5 days */ /* * How often to run the networker -- 2.30.2