mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
SMTP: add brackets for MAIL FROM
Similar to what is done already for RCPT TO, the code now checks for and adds angle brackets (<>) around the email address that is provided for CURLOPT_MAIL_RCPT unless the app has done so itself.
This commit is contained in:
parent
5f829456c1
commit
375aa41ba1
10
lib/smtp.c
10
lib/smtp.c
@ -754,9 +754,13 @@ static CURLcode smtp_mail(struct connectdata *conn)
|
|||||||
CURLcode result = CURLE_OK;
|
CURLcode result = CURLE_OK;
|
||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
|
|
||||||
/* send MAIL */
|
/* send MAIL FROM */
|
||||||
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s",
|
if (data->set.str[STRING_MAIL_FROM][0] == '<')
|
||||||
data->set.str[STRING_MAIL_FROM]);
|
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s",
|
||||||
|
data->set.str[STRING_MAIL_FROM]);
|
||||||
|
else
|
||||||
|
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:<%s>",
|
||||||
|
data->set.str[STRING_MAIL_FROM]);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user