smtp: Added support for the conversion of Unix newlines during mail send

Added support for the automatic conversion of Unix newlines to CRLF
during mail uploads.

Feature: http://curl.haxx.se/bug/view.cgi?id=1456
This commit is contained in:
Steve Holme
2014-11-26 22:44:28 +00:00
parent aa3e8dd3da
commit 4bd860a001
2 changed files with 29 additions and 18 deletions

View File

@@ -903,15 +903,6 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
/* store number of bytes available for upload */
data->req.upload_present = nread;
#ifndef CURL_DISABLE_SMTP
if(conn->handler->protocol & PROTO_FAMILY_SMTP) {
result = Curl_smtp_escape_eob(conn, nread);
if(result)
return result;
}
else
#endif /* CURL_DISABLE_SMTP */
/* convert LF to CRLF if so asked */
if((!sending_http_headers) && (
#ifdef CURL_DO_LINEEND_CONV
@@ -962,6 +953,14 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
that instead of reading more data */
}
#ifndef CURL_DISABLE_SMTP
if(conn->handler->protocol & PROTO_FAMILY_SMTP) {
result = Curl_smtp_escape_eob(conn, nread);
if(result)
return result;
}
#endif /* CURL_DISABLE_SMTP */
/* write to socket (send away data) */
result = Curl_write(conn,
conn->writesockfd, /* socket to send to */