]> 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 927d8206d4fd7ac95bb9f95d3d05e7704304bdec..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 Welcome to the Citadel/UX ESMTP server at %s\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");
@@ -119,7 +128,7 @@ void smtp_hello(char *argbuf, int is_esmtp) {
  * Implement HELP command.
  */
 void smtp_help(void) {
-       cprintf("214-Here's the frequency, Kenneth:\r\n");
+       cprintf("214-Commands accepted:\r\n");
        cprintf("214-    DATA\r\n");
        cprintf("214-    EHLO\r\n");
        cprintf("214-    EXPN\r\n");
@@ -131,7 +140,7 @@ void smtp_help(void) {
        cprintf("214-    RCPT\r\n");
        cprintf("214-    RSET\r\n");
        cprintf("214-    VRFY\r\n");
-       cprintf("214 I could tell you more, but then I'd have to kill you.\r\n");
+       cprintf("214     \r\n");
 }
 
 
@@ -440,7 +449,7 @@ void smtp_rcpt(char *argbuf) {
 
                case rfc822_address_nonlocal:
                        if (SMTP->message_originated_locally == 0) {
-                               cprintf("551 Relaying denied\r\n");
+                               cprintf("551 Third-party relaying denied.\r\n");
                        }
                        else {
                                cprintf("250 Remote recipient %s ok\r\n", recp);
@@ -672,7 +681,7 @@ void smtp_data(void) {
        CtdlFreeMessage(msg);
 
        if (!retval) {
-               cprintf("250 Message accepted for delivery.\r\n");
+               cprintf("250 ok terrific\r\n");
        }
        else {
                cprintf("550 Internal delivery errors: %d\r\n", retval);
@@ -759,7 +768,7 @@ void smtp_command_loop(void) {
        }
 
        else {
-               cprintf("502 I'm sorry Dave, I'm afraid I can't do that.\r\n");
+               cprintf("502 I'm afraid I can't do that.\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")) {
@@ -1475,7 +1487,7 @@ char *Dynamic_Module_Init(void)
                                smtp_greeting,
                                smtp_command_loop);
 
-       create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0);
+       create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0, 1);
        CtdlRegisterSessionHook(smtp_do_queue, EVT_TIMER);
        return "$Id$";
 }