]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_smtp.c
* serv_smtp.c: instead of doubling delivery retry times unbounded, set a
[citadel.git] / citadel / serv_smtp.c
index ddbe9398cdb1e9cdd4ebe3b61bb440f77b7da2c5..7cd291824dcf4fd63dd988b5d2bb7aa47cfa6e6f 100644 (file)
 #include <pwd.h>
 #include <errno.h>
 #include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  include <time.h>
+# endif
+#endif
+
 #include <sys/wait.h>
 #include <ctype.h>
 #include <string.h>
 #include <limits.h>
-#include <time.h>
 #include "citadel.h"
 #include "server.h"
 #include "sysdep_decls.h"
@@ -91,8 +101,7 @@ void smtp_greeting(void) {
        CtdlAllocUserData(SYM_SMTP_RECP, SIZ);
        sprintf(SMTP_RECP, "%s", "");
 
-       cprintf("220 Citadel/UX ESMTP server at %s ready.\r\n",
-               config.c_fqdn);
+       cprintf("220 %s ESMTP Citadel/UX server ready.\r\n", config.c_fqdn);
 }
 
 
@@ -107,7 +116,7 @@ void smtp_hello(char *argbuf, int is_esmtp) {
                cprintf("250 Greetings and joyous salutations.\r\n");
        }
        else {
-               cprintf("250-Greetings and joyous salutations.\r\n");
+               cprintf("250-Extended greetings and joyous salutations.\r\n");
                cprintf("250-HELP\r\n");
                cprintf("250-SIZE %ld\r\n", config.c_maxmsglen);
                cprintf("250 AUTH=LOGIN\r\n");
@@ -1305,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")) {