aboutsummaryrefslogtreecommitdiff
path: root/lib/smtp.c
diff options
context:
space:
mode:
authorPatrick Monnerat <patrick@monnerat.net>2018-02-12 16:43:15 +0100
committerPatrick Monnerat <patrick@monnerat.net>2018-02-12 16:43:15 +0100
commit62cf2d180ed77bb977acf5d8b348d4431256638f (patch)
tree38226912efdc7c236a670c2f865c60e51617d349 /lib/smtp.c
parent3f6051f4ed2195a24adbc29036ee5ee0ef00b1e9 (diff)
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 <CRLF>.<CRLF> 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
Diffstat (limited to 'lib/smtp.c')
-rw-r--r--lib/smtp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index d9f1a854a..3f3b45a95 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -1289,6 +1289,11 @@ static CURLcode smtp_perform(struct connectdata *conn, bool *connected,
/* Store the first recipient (or NULL if not specified) */
smtp->rcpt = data->set.mail_rcpt;
+ /* Initial data character is the first character in line: it is implicitly
+ preceded by a virtual CRLF. */
+ smtp->trailing_crlf = TRUE;
+ smtp->eob = 2;
+
/* Start the first command in the DO phase */
if((data->set.upload || data->set.mimepost.kind) && data->set.mail_rcpt)
/* MAIL transfer */