cURL / Mailing Lists / curl-library / Single Mail

curl-library

SMTP: CURLOPT_MAIL_FROM vs CURLOPT_USERNAME

From: Chandran, Naveen <naveen.chandran_at_hp.com>
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, <invalid_email_at_somedomain.com> ); // 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://smtp.gmail.com:587]

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.

Thanks,
Naveen

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-06-10