Removed the VRFY and EXPN commands from our SMTP server
authorArt Cancro <ajc@citadel.org>
Wed, 27 Jun 2007 05:06:31 +0000 (05:06 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 27 Jun 2007 05:06:31 +0000 (05:06 +0000)
implementation because nobody uses these commands anymore
except for spammers.

citadel/file_ops.c
citadel/serv_sieve.c
citadel/serv_smtp.c

index bf4cee5b1f32c1393805b1b37868453e355b8a4f..a6cf80b7a087c8ef2d74b867d7a97811b10bf2dd 100644 (file)
@@ -280,7 +280,7 @@ void cmd_netf(char *cmdbuf)
        putc(255, ofp);
        putc(MES_NORMAL, ofp);
        putc(0, ofp);
-       fprintf(ofp, "Pcit%ld", CC->user.usernum);
+       fprintf(ofp, "P%s", CC->user.fullname);
        putc(0, ofp);
        time(&now);
        fprintf(ofp, "T%ld", (long) now);
index e8277d697324ff5dc7061fc13bab3a066dd82b5e..3418ab8d9f52c8c29f18119b4be7334f69b4f642 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: serv_sieve.c 3850 2005-09-13 14:00:24Z ajc $
+ * $Id$
  *
  * This module glues libSieve to the Citadel server in order to implement
  * the Sieve mailbox filtering language (RFC 3028).
@@ -59,7 +59,7 @@ char *msiv_extensions = NULL;
  */
 int ctdl_debug(sieve2_context_t *s, void *my)
 {
-       static int ctdl_libsieve_debug = 0;
+       static int ctdl_libsieve_debug = 1;
 
        if (ctdl_libsieve_debug) {
 /*
@@ -1231,7 +1231,7 @@ char *serv_sieve_init(void)
 {
        ctdl_sieve_init();
        CtdlRegisterProtoHook(cmd_msiv, "MSIV", "Manage Sieve scripts");
-       return "$Id: serv_sieve.c 3850 2005-09-13 14:00:24Z ajc $";
+       return "$Id$";
 }
 
 #else  /* HAVE_LIBSIEVE */
@@ -1239,7 +1239,7 @@ char *serv_sieve_init(void)
 char *serv_sieve_init(void)
 {
        lprintf(CTDL_INFO, "This server is missing libsieve.  Mailbox filtering will be disabled.\n");
-       return "$Id: serv_sieve.c 3850 2005-09-13 14:00:24Z ajc $";
+       return "$Id$";
 }
 
 #endif /* HAVE_LIBSIEVE */
index d4ff45a83a73c053d85c0a9ba30d880ef86da9b3..a9e46f681b92a7e8a0fe79cb38c19fb58a382116 100644 (file)
@@ -20,6 +20,9 @@
  * RFC 2821 - Simple Mail Transfer Protocol
  * RFC 2822 - Internet Message Format
  * RFC 2920 - SMTP Service Extension for Command Pipelining
+ *  
+ * The VRFY and EXPN commands have been removed from this implementation
+ * because nobody uses these commands anymore, except for spammers.
  *
  */
 
@@ -86,9 +89,6 @@
 struct citsmtp {               /* Information about the current session */
        int command_state;
        char helo_node[SIZ];
-       struct ctdluser vrfy_buffer;
-       int vrfy_count;
-       char vrfy_match[SIZ];
        char from[SIZ];
        char recipients[SIZ];
        int number_of_recipients;
@@ -295,7 +295,6 @@ void smtp_help(void) {
        cprintf("214-Commands accepted:\r\n");
        cprintf("214-    DATA\r\n");
        cprintf("214-    EHLO\r\n");
-       cprintf("214-    EXPN\r\n");
        cprintf("214-    HELO\r\n");
        cprintf("214-    HELP\r\n");
        cprintf("214-    MAIL\r\n");
@@ -303,7 +302,6 @@ void smtp_help(void) {
        cprintf("214-    QUIT\r\n");
        cprintf("214-    RCPT\r\n");
        cprintf("214-    RSET\r\n");
-       cprintf("214-    VRFY\r\n");
        cprintf("214     \r\n");
 }
 
@@ -422,86 +420,6 @@ void smtp_auth(char *argbuf) {
 }
 
 
-/*
- * Back end for smtp_vrfy() command
- */
-void smtp_vrfy_backend(struct ctdluser *us, void *data) {
-
-       if (!fuzzy_match(us, SMTP->vrfy_match)) {
-               ++SMTP->vrfy_count;
-               memcpy(&SMTP->vrfy_buffer, us, sizeof(struct ctdluser));
-       }
-}
-
-
-/* 
- * Implements the VRFY (verify user name) command.
- * Performs fuzzy match on full user names.
- */
-void smtp_vrfy(char *argbuf) {
-       SMTP->vrfy_count = 0;
-       strcpy(SMTP->vrfy_match, argbuf);
-       ForEachUser(smtp_vrfy_backend, NULL);
-
-       if (SMTP->vrfy_count < 1) {
-               cprintf("550 5.1.1 String does not match anything.\r\n");
-       }
-       else if (SMTP->vrfy_count == 1) {
-               cprintf("250 %s <cit%ld@%s>\r\n",
-                       SMTP->vrfy_buffer.fullname,
-                       SMTP->vrfy_buffer.usernum,
-                       config.c_fqdn);
-       }
-       else if (SMTP->vrfy_count > 1) {
-               cprintf("553 5.1.4 Request ambiguous: %d users matched.\r\n",
-                       SMTP->vrfy_count);
-       }
-
-}
-
-
-
-/*
- * Back end for smtp_expn() command
- */
-void smtp_expn_backend(struct ctdluser *us, void *data) {
-
-       if (!fuzzy_match(us, SMTP->vrfy_match)) {
-
-               if (SMTP->vrfy_count >= 1) {
-                       cprintf("250-%s <cit%ld@%s>\r\n",
-                               SMTP->vrfy_buffer.fullname,
-                               SMTP->vrfy_buffer.usernum,
-                               config.c_fqdn);
-               }
-
-               ++SMTP->vrfy_count;
-               memcpy(&SMTP->vrfy_buffer, us, sizeof(struct ctdluser));
-       }
-}
-
-
-/* 
- * Implements the EXPN (expand user name) command.
- * Performs fuzzy match on full user names.
- */
-void smtp_expn(char *argbuf) {
-       SMTP->vrfy_count = 0;
-       strcpy(SMTP->vrfy_match, argbuf);
-       ForEachUser(smtp_expn_backend, NULL);
-
-       if (SMTP->vrfy_count < 1) {
-               cprintf("550 5.1.1 String does not match anything.\r\n");
-       }
-       else if (SMTP->vrfy_count >= 1) {
-               cprintf("250 %s <cit%ld@%s>\r\n",
-                       SMTP->vrfy_buffer.fullname,
-                       SMTP->vrfy_buffer.usernum,
-                       config.c_fqdn);
-       }
-}
-
-
 /*
  * Implements the RSET (reset state) command.
  * Currently this just zeroes out the state buffer.  If pointers to data
@@ -924,10 +842,6 @@ void smtp_command_loop(void) {
                smtp_data();
        }
 
-       else if (!strncasecmp(cmdbuf, "EXPN", 4)) {
-               smtp_expn(&cmdbuf[5]);
-       }
-
        else if (!strncasecmp(cmdbuf, "HELO", 4)) {
                smtp_hello(&cmdbuf[5], 0);
        }
@@ -970,10 +884,6 @@ void smtp_command_loop(void) {
                smtp_starttls();
        }
 #endif
-       else if (!strncasecmp(cmdbuf, "VRFY", 4)) {
-               smtp_vrfy(&cmdbuf[5]);
-       }
-
        else {
                cprintf("502 5.0.0 I'm afraid I can't do that.\r\n");
        }