From 4a4609bf3c812afc65f700b4b7e673cc76ade1bf Mon Sep 17 00:00:00 2001 From: Pavel Volgarev Date: Tue, 14 Jan 2020 17:22:38 -0500 Subject: smtp: Allow RCPT TO command to fail for some recipients Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816 --- tests/data/Makefile.inc | 3 ++- tests/data/test3002 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test3003 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test3004 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test3005 | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ tests/data/test3006 | 51 +++++++++++++++++++++++++++++++++++++++++++++ tests/data/test3007 | 47 ++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 320 insertions(+), 1 deletion(-) create mode 100644 tests/data/test3002 create mode 100644 tests/data/test3003 create mode 100644 tests/data/test3004 create mode 100644 tests/data/test3005 create mode 100644 tests/data/test3006 create mode 100644 tests/data/test3007 (limited to 'tests') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 51cc92062..f72ccbc16 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -208,4 +208,5 @@ test2078 \ test2080 \ test2100 \ \ -test3000 test3001 +test3000 test3001 \ +test3002 test3003 test3004 test3005 test3006 test3007 diff --git a/tests/data/test3002 b/tests/data/test3002 new file mode 100644 index 000000000..ac6820214 --- /dev/null +++ b/tests/data/test3002 @@ -0,0 +1,55 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP with multiple and invalid (first) --mail-rcpt and --mail-rcpt-allowfails + + +From: different +To: another + +body + + +smtp://%HOSTIP:%SMTPPORT/3002 --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + + +EHLO 3002 +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT + + +From: different +To: another + +body +. + + + diff --git a/tests/data/test3003 b/tests/data/test3003 new file mode 100644 index 000000000..7515affbc --- /dev/null +++ b/tests/data/test3003 @@ -0,0 +1,55 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP with multiple and invalid (last) --mail-rcpt and --mail-rcpt-allowfails + + +From: different +To: another + +body + + +smtp://%HOSTIP:%SMTPPORT/3003 --mail-rcpt-allowfails --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt recipient.three@example.com --mail-rcpt recipient.four@example.com --mail-rcpt invalid.five --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + + +EHLO 3003 +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT + + +From: different +To: another + +body +. + + + diff --git a/tests/data/test3004 b/tests/data/test3004 new file mode 100644 index 000000000..e021cde41 --- /dev/null +++ b/tests/data/test3004 @@ -0,0 +1,55 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP with multiple and invalid (middle) --mail-rcpt and --mail-rcpt-allowfails + + +From: different +To: another + +body + + +smtp://%HOSTIP:%SMTPPORT/3004 --mail-rcpt-allowfails --mail-rcpt recipient.one@example.com --mail-rcpt recipient.two@example.com --mail-rcpt invalid.three --mail-rcpt recipient.four@example.com --mail-rcpt recipient.five@example.com --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + + +EHLO 3004 +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT + + +From: different +To: another + +body +. + + + diff --git a/tests/data/test3005 b/tests/data/test3005 new file mode 100644 index 000000000..256555ac9 --- /dev/null +++ b/tests/data/test3005 @@ -0,0 +1,55 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP with multiple and invalid (all but one) --mail-rcpt and --mail-rcpt-allowfails + + +From: different +To: another + +body + + +smtp://%HOSTIP:%SMTPPORT/3005 --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt recipient.two@example.com --mail-rcpt invalid.three --mail-rcpt invalid.four --mail-rcpt invalid.five --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + + +EHLO 3005 +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +DATA +QUIT + + +From: different +To: another + +body +. + + + diff --git a/tests/data/test3006 b/tests/data/test3006 new file mode 100644 index 000000000..f54d71c8d --- /dev/null +++ b/tests/data/test3006 @@ -0,0 +1,51 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP with multiple invalid (all) --mail-rcpt and --mail-rcpt-allowfails + + +From: different +To: another + +body + + +smtp://%HOSTIP:%SMTPPORT/3006 --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-rcpt invalid.two --mail-rcpt invalid.three --mail-rcpt invalid.four --mail-rcpt invalid.five --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + +# 55 - CURLE_SEND_ERROR + +55 + + +EHLO 3006 +MAIL FROM: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +RCPT TO: +QUIT + + + diff --git a/tests/data/test3007 b/tests/data/test3007 new file mode 100644 index 000000000..b0d690262 --- /dev/null +++ b/tests/data/test3007 @@ -0,0 +1,47 @@ + + + +SMTP + + + +# +# Server-side + + + +# +# Client-side + + +smtp + + +SMTP with invalid --mail-rcpt and --mail-rcpt-allowfails + + +From: different +To: another + +body + + +smtp://%HOSTIP:%SMTPPORT/3007 --mail-rcpt-allowfails --mail-rcpt invalid.one --mail-from sender@example.com -T - + + + +# +# Verify data after the test has been "shot" + +# 55 - CURLE_SEND_ERROR + +55 + + +EHLO 3007 +MAIL FROM: +RCPT TO: +QUIT + + + -- cgit v1.2.3