From 62cf2d180ed77bb977acf5d8b348d4431256638f Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Mon, 12 Feb 2018 16:43:15 +0100 Subject: smtp: fix processing of initial dot in data RFC 5321 4.1.1.4 specifies the CRLF terminating the DATA command should be taken into account when chasing the . end marker. Thus a leading dot character in data is also subject to escaping. Tests 911 and test server are adapted to this situation. New tests 951 and 952 check proper handling of initial dot in data. Closes #2304 --- tests/data/Makefile.inc | 2 +- tests/data/test911 | 1 - tests/data/test951 | 45 +++++++++++++++++++++++++++++++++++++++++++++ tests/data/test952 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 tests/data/test951 create mode 100644 tests/data/test952 (limited to 'tests/data') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 9635d12a1..31d299942 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -103,7 +103,7 @@ test909 test910 test911 test912 test913 test914 test915 test916 test917 \ test918 test919 test920 test921 test922 test923 test924 test925 test926 \ test927 test928 test929 test930 test931 test932 test933 test934 test935 \ test936 test937 test938 test939 test940 test941 test942 test943 test944 \ -test945 test946 test947 test948 test949 test950 \ +test945 test946 test947 test948 test949 test950 test951 test952 \ \ test1000 test1001 test1002 test1003 test1004 test1005 test1006 test1007 \ test1008 test1009 test1010 test1011 test1012 test1013 test1014 test1015 \ diff --git a/tests/data/test911 b/tests/data/test911 index cc87349b8..f4c545830 100644 --- a/tests/data/test911 +++ b/tests/data/test911 @@ -40,7 +40,6 @@ DATA QUIT - . diff --git a/tests/data/test951 b/tests/data/test951 new file mode 100644 index 000000000..7d2e17b1b --- /dev/null +++ b/tests/data/test951 @@ -0,0 +1,45 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP data with dot as first character + + +.This first line starts with a dot + + +smtp://%HOSTIP:%SMTPPORT/951 --mail-rcpt recipient@example.com --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + + +EHLO 951 +MAIL FROM: +RCPT TO: +DATA +QUIT + + +..This first line starts with a dot +. + + + diff --git a/tests/data/test952 b/tests/data/test952 new file mode 100644 index 000000000..54334b21e --- /dev/null +++ b/tests/data/test952 @@ -0,0 +1,45 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP data with single dot-only line + + +. + + +smtp://%HOSTIP:%SMTPPORT/952 --mail-rcpt recipient@example.com --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + + +EHLO 952 +MAIL FROM: +RCPT TO: +DATA +QUIT + + +.. +. + + + -- cgit v1.2.3