]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_smtp.c
warning fixes and cleanups for 64-bit machines
[citadel.git] / citadel / serv_smtp.c
index 55d81f57b3d45d3a897f466e21fe8a060c4d7c0d..2d3ef0ceb15cd629fba46c21ec2a5caab73b3803 100644 (file)
 #include "clientsocket.h"
 
 
+#ifndef HAVE_SNPRINTF
+#include "snprintf.h"
+#endif
+
 struct citsmtp {               /* Information about the current session */
        int command_state;
        char helo_node[SIZ];
@@ -101,8 +105,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);
 }
 
 
@@ -117,9 +120,10 @@ 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-PIPELINING\r\n");
                cprintf("250 AUTH=LOGIN\r\n");
        }
 }
@@ -747,14 +751,14 @@ void smtp_command_loop(void) {
        }
 
        else if (!strncasecmp(cmdbuf, "NOOP", 4)) {
-               cprintf("250 This command successfully did nothing.\r\n");
+               cprintf("250 NOOP\r\n");
        }
 
        else if (!strncasecmp(cmdbuf, "QUIT", 4)) {
                cprintf("221 Goodbye...\r\n");
                CC->kill_me = 1;
                return;
-               }
+       }
 
        else if (!strncasecmp(cmdbuf, "RCPT", 4)) {
                smtp_rcpt(&cmdbuf[5]);
@@ -1315,6 +1319,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")) {