summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2016-09-01 18:25:58 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2016-09-01 21:15:47 +0100
commit45bd315dc080b8f77679ba5ae60e35b0d8c9e97c (patch)
treecb2c9063a3fd7eb6bd6eebe2971da4878b2846db /src
parentfbbd45ff5ade30d38ca60ea5aeccc305501c9174 (diff)
CHUNKING: after rejecting a pipelined SMTP command, flush any followon BDAT data
Diffstat (limited to 'src')
-rw-r--r--src/src/smtp_in.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index 09356c231..597b88e38 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -476,6 +476,20 @@ next_cmd:
}
}
+static void
+bdat_flush_data(void)
+{
+while (chunking_data_left-- > 0)
+ if (lwr_receive_getc() < 0)
+ break;
+
+receive_getc = lwr_receive_getc;
+receive_ungetc = lwr_receive_ungetc;
+
+if (chunking_state != CHUNKING_LAST)
+ chunking_state = CHUNKING_OFFERED;
+}
+
@@ -4775,6 +4789,9 @@ while (done <= 0)
smtp_connection_had[smtp_ch_index-1] == SCH_DATA
? US"valid RCPT command must precede DATA"
: US"valid RCPT command must precede BDAT");
+
+ if (chunking_state > CHUNKING_OFFERED)
+ bdat_flush_data();
break;
}