diff --git a/src/config.h b/src/config.h index 92295abd..c1821a4d 100644 --- a/src/config.h +++ b/src/config.h @@ -13,7 +13,7 @@ #define VERSION "0.1.22" -#define BUILD 732 +#define BUILD 734 #define HOSTID "mailarchiver" diff --git a/src/session.c b/src/session.c index 4524d141..f9ee9847 100644 --- a/src/session.c +++ b/src/session.c @@ -357,10 +357,20 @@ AFTER_PERIOD: if(strncasecmp(buf, SMTP_CMD_MAIL_FROM, strlen(SMTP_CMD_MAIL_FROM)) == 0){ - if(state != SMTP_STATE_HELO){ + if(state != SMTP_STATE_HELO && state != SMTP_STATE_PERIOD){ strncat(resp, SMTP_RESP_503_ERR, MAXBUFSIZE-1); - } + } else { + + if(state == SMTP_STATE_PERIOD){ + if(cfg->verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "%s: initiated new transaction", sdata.ttmpfile); + + unlink(sdata.ttmpfile); + unlink(sdata.tmpframe); + + init_session_data(&sdata); + } + state = SMTP_STATE_MAIL_FROM; snprintf(sdata.mailfrom, SMALLBUFSIZE-1, "%s\r\n", buf);