]> code.citadel.org Git - citadel.git/commitdiff
* serv_smtp.c: clear the relevant state buffers after an SMTP DATA command
authorArt Cancro <ajc@citadel.org>
Thu, 11 May 2000 03:08:47 +0000 (03:08 +0000)
committerArt Cancro <ajc@citadel.org>
Thu, 11 May 2000 03:08:47 +0000 (03:08 +0000)
  completes, allowing multiple messages in one session.  Closes bug #58.

citadel/ChangeLog
citadel/serv_smtp.c

index 501a373cd28e2272557c1361531ab7d90f66fe7a..5b6eb1cab76c0456dfbca835fd613e1f16ccff79 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 571.5  2000/05/11 03:08:47  ajc
+ * serv_smtp.c: clear the relevant state buffers after an SMTP DATA command
+   completes, allowing multiple messages in one session.  Closes bug #58.
+
  Revision 571.4  2000/04/24 03:36:43  ajc
  * Removed references to strucmp() and struncmp(), replaced them with
    strcasecmp() and strncasecmp() as we did in the server a while ago, and
@@ -1868,3 +1872,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Initial CVS import 
+
index de8aa98bff15e37e733ee1c0fb3f26492fe49789..dc6c5174e84dc2d2e8b87b8ec00863bd643bed4b 100644 (file)
@@ -282,10 +282,23 @@ void smtp_expn(char *argbuf) {
  */
 void smtp_rset(void) {
        memset(SMTP, 0, sizeof(struct citsmtp));
+       if (SMTP_RECP != NULL) strcpy(SMTP_RECP, "");
        if (CC->logged_in) logout(CC);
        cprintf("250 Zap!\r\n");
 }
 
+/*
+ * Clear out the portions of the state buffer that need to be cleared out
+ * after the DATA command finishes.
+ */
+void smtp_data_clear(void) {
+       strcpy(SMTP->from, "");
+       SMTP->number_of_recipients = 0;
+       SMTP->delivery_mode = 0;
+       SMTP->message_originated_locally = 0;
+       if (SMTP_RECP != NULL) strcpy(SMTP_RECP, "");
+}
+
 
 
 /*
@@ -653,6 +666,8 @@ void smtp_data(void) {
        else {
                cprintf("550 Internal delivery errors: %d\r\n", retval);
        }
+
+       smtp_data_clear();      /* clear out the buffers now */
 }