* Added RSET command
authorArt Cancro <ajc@citadel.org>
Sat, 11 Dec 1999 00:09:46 +0000 (00:09 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 11 Dec 1999 00:09:46 +0000 (00:09 +0000)
citadel/serv_smtp.c

index 2829c3341a25f2e4e524d47bb2031c7c9d526f59..30a1daf1053560ac4da23c87a76521c7681e9a58 100644 (file)
@@ -90,6 +90,7 @@ void smtp_help(void) {
        cprintf("214-    HELP\n");
        cprintf("214-    NOOP\n");
        cprintf("214-    QUIT\n");
+       cprintf("214-    RSET\n");
        cprintf("214-    VRFY\n");
        cprintf("214 I could tell you more, but then I'd have to kill you.\n");
 }
@@ -238,6 +239,18 @@ void smtp_expn(char *argbuf) {
 }
 
 
+/*
+ * Implements the RSET (reset state) command.
+ * Currently this just zeroes out the state buffer.  If pointers to data
+ * allocated with mallok() are ever placed in the state buffer, we have to
+ * be sure to phree() them first!
+ */
+void smtp_rset(void) {
+       memset(SMTP, 0, sizeof(struct citsmtp));
+       cprintf("250 Zap!\n");
+}
+
+
 
 /* 
  * Main command loop for SMTP sessions.
@@ -293,6 +306,10 @@ void smtp_command_loop(void) {
                return;
                }
 
+       else if (!strncasecmp(cmdbuf, "RSET", 4)) {
+               smtp_rset();
+       }
+
        else if (!strncasecmp(cmdbuf, "VRFY", 4)) {
                smtp_vrfy(&cmdbuf[5]);
        }