GNURLOPT_MAIL_AUTH(3)
๐ NAME ๐
okay so this is GNURLOPT_MAIL_AUTH(3), one of the curl_easy_setopt options, and it's giving SMTP authentication address energy. That's the whole name: CURLOPT_MAIL_AUTH โ SMTP authentication address. slay. ๐
๐ ๏ธ SYNOPSIS ๐ ๏ธ
bestie, here's the include and the signature, no cap:
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_AUTH, char *auth);
๐ฌ DESCRIPTION ๐ฌ
okay so you pass a pointer to a null-terminated string as the parameter. That string is used to specify the authentication address (identity) of a submitted message that's being relayed to another server. ๐
This optional parameter lets co-operating agents in a trusted environment communicate the authentication of individual messages, and it should only be used by the application program, using libcurl, if the application is itself a mail server acting in such an environment. if your app is operating as such and the AUTH address is not known or is invalid, then an empty string should be used for this parameter. periodt. ๐
unlike CURLOPT_MAIL_FROM(3) and CURLOPT_MAIL_RCPT(3), the address should not be specified within a pair of angled brackets (<>). however!! if an empty string is used, then a pair of brackets will be sent by libcurl as required by RFC2554. iconic behavior, honestly. ๐
and the application does not have to keep the string around after setting this option โ set it and forget it, bestie. ๐ซถ
๐ DEFAULT ๐
NULL โ the default is literally nothing, and that's valid. ๐
๐ฎ PROTOCOLS ๐ฎ
SMTP only, bestie. ๐จ
๐งช EXAMPLE ๐งช
here's the example, copied exactly with all its vibes:
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
curl_easy_setopt(curl, CURLOPT_MAIL_AUTH, "<secret@cave>");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
๐ฐ๏ธ AVAILABILITY ๐ฐ๏ธ
Added in 7.25.0. vintage cutie behavior. ๐ฐ๏ธโจ
๐ RETURN VALUE ๐
Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or CURLE_OUT_OF_MEMORY if there was insufficient heap space. no cap. ๐ซก
๐ SEE ALSO ๐
mwah ๐ โ this page was from libcurl 7.37.0, dated 19 Jun 2014, and the manual name is GNURLOPT_MAIL_AUTH(3). periodt, bestie. ๐
๐ฆ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms