fixed an smtp chat bug related to multiple transactions

This commit is contained in:
SJ 2012-12-02 17:17:41 +01:00
parent 0e30f9bd57
commit 22d9828e8f
2 changed files with 13 additions and 3 deletions

View File

@ -13,7 +13,7 @@
#define VERSION "0.1.22"
#define BUILD 732
#define BUILD 734
#define HOSTID "mailarchiver"

View File

@ -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);