CURLOPT_MAIL_AUTH(3)
π CURLOPT_MAIL_AUTH(3) π
okay so bestie, welcome to the Library Functions Manual page for CURLOPT_MAIL_AUTH(3). It's giving SMTP authentication address realness, and we're gonna get through every single deet together. π«Ά
β¨ NAME β¨
CURLOPT_MAIL_AUTHβ SMTP authentication address
π οΈ SYNOPSIS π οΈ
#include <curl/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. This is used to specify the authentication address (identity) of a submitted message that is being relayed to another server. Lowkey important, highkey specific.
This optional parameter allows co-operating agents in a trusted environment to communicate the authentication of individual messages. 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 the application is operating as such and the AUTH address is not known or is invalid, then an empty string should be used for this parameter. No cap, that's the rule.
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 are sent by libcurl as required by RFC 2554. So like, the brackets can still show up on the wire even though you're not typing them yourself β that's the libcurl glow-up. β¨
The application does not have to keep the string around after setting this option. Literally set it and forget it, bestie.
Using this option multiple times makes the last set string override the previous ones. Set it to NULL to disable its use again. Periodt.
π DEFAULT π
NULL β that's the default, bestie. The void before you set anything. π³οΈ
π PROTOCOLS π
This functionality affects smtp only. SMTP girlies only, iykyk. π
π EXAMPLE π
Here's the example, character for character:
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
curl_easy_setopt(curl, CURLOPT_MAIL_AUTH, "<secret@cave>");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
π¦ AVAILABILITY π¦
Added in curl 7.25.0. Iconic vintage, honestly. π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK, non-zero means an error occurred, see libcurl-errors(3).
π SEE ALSO π
mwah π β this page is from libcurl, dated 2026-10-12, and its footer title is CURLOPT_MAIL_AUTH(3). periodt. π«Ά
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms