cURL / Mailing Lists / curl-library / Single Mail



From: Chandran, Naveen <>
Date: Tue, 10 Jun 2014 14:09:07 +0000

Hi Daniel/Steve,

When testing with the latest libcurl version (curl 7.37.0) for SMTP, I observe that libcurl actually permits sending of emails even when an invalid FROM (or sender address) is passed to libcurl,
but valid values (corresponding to an actual mailbox id) are maintained for the username/password options to curl.

That is to say, in a sample smtp code (using the easy interface), I tried setting the curl options thus:

        curl_easy_setopt ( curl, CURLOPT_MAIL_FROM, <> ); // an invalid (non-existent) FROM address

        curl_easy_setopt ( curl, CURLOPT_USERNAME, "valid_username" ); // valid user name here
        curl_easy_setopt ( curl, CURLOPT_PASSWORD, "valid_password" ); // valid password here

[Note: For this, I used the example source code available at curl (smtp-mail.c), and for the SMTP server, pointed to smtp://]

What I see is, that emails actually are sent to the intended recipient(s) and in the received mails, the 'sender/From address' reflects the username value that was provided to CURLOPT_USERNAME.

Kindly let me know if this behavior is actually as per any of the governing RFCs for SMTP.


List admin:
Received on 2014-06-10