fix buffering issue introduced with the simplifed handle_data()

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-03-04 20:16:30 +01:00
parent 1d0019ff35
commit 2ca822c689
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@
#define VERSION "1.3.4" #define VERSION "1.3.4"
#define BUILD 992 #define BUILD 993
#define HOSTID "mailarchiver" #define HOSTID "mailarchiver"

View File

@ -195,7 +195,9 @@ void handle_data(struct smtp_session *session, char *readbuf, int readlen, struc
p += puflen; p += puflen;
if(puflen > 0){ if(puflen > 0){
if(session->protocol_state == SMTP_STATE_DATA){ // pass the puffer to process_data() only if there was an '\n'
// on the line or the puffer does not start with a period
if(session->protocol_state == SMTP_STATE_DATA && (rc == OK || puf[0] != '.')){
process_data(session, puf, puflen); process_data(session, puf, puflen);
} }
else if(session->protocol_state == SMTP_STATE_BDAT){ else if(session->protocol_state == SMTP_STATE_BDAT){