CURLOPT_MAIL_RCPT_ALLLOWFAILS(3)
β¨ CURLOPT_MAIL_RCPT_ALLLOWFAILS β¨
okay bestie so this is a curl_easy_setopt option, it lives in the curl_easy_setopt options manual fam, and yes the name has three whole L's in ALLLOWFAILS β that's not a typo, that's just how it is, we don't question it, we respect it π
πΈ NAME πΈ
CURLOPT_MAIL_RCPT_ALLLOWFAILS β let the RCPT TO command fail for some recipients and not have the whole thing blow up π«Ά
π SYNOPSIS π
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_RCPT_ALLLOWFAILS,
long allow);
π¦ DESCRIPTION π¦
So if allow is set to 1L, you're telling curl: yeah, let the RCPT TO command fail for some recipients, it's fine, we're chill like that.
Here's the tea though π β when you're sending data to multiple recipients, curl's default vibe is very much "one of you messes up, everybody's going home." Like, if even one recipient makes RCPT TO return an error, curl just aborts the whole SMTP conversation. Not very demure, but that's the default.
You can switch up that default behavior by setting ignore to 1L, which makes curl ignore the errors and just keep going with the remaining valid recipients. main character energy honestly π
β οΈ but bestie, listen β if ALL the recipients triggerRCPT TOfailures and you've specified this flag? curl will still abort the SMTP conversation and return the error received from to the lastRCPT TOcommand. So like, no saving you if literally everyone flops π
π DEFAULT π
0
π PROTOCOLS π
SMTP
π§ EXAMPLE π§
CURL *curl = curl_easy_init();
if(curl) {
struct curl_slist *list;
/* Adding one valid and one invalid email address */
list = curl_slist_append(NULL, "person@example.com");
list = curl_slist_append(list, "invalidemailaddress");
curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
curl_easy_setopt(curl, CURLOPT_MAIL_RCPT_ALLLOWFAILS, 1L);
ret = curl_easy_perform(curl);
curl_slist_free_all(list);
curl_easy_cleanup(curl);
}
one valid email, one absolute mess of an email, and curl's just gonna keep it moving πβ¨
β AVAILABILITY β
Added in 7.69.0. she's been around, she's established, she's an icon π
π₯ RETURN VALUE π₯
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. simple as that, no cap π
π SEE ALSO π
mwah, that's the whole page π this is from libcurl 7.88.1, dated January 02, 2023 β go forth and send your emails, bestie, and remember: one bad recipient does not have to ruin the whole party π«Άβ¨π
π¦ where this page comes from
- debian bookworm: libcurl4-doc 7.88.1-10+deb12u15 Β· curl
- debian bookworm: libcurl4-doc 7.88.1-10+deb12u5 Β· curl
- π the page's license: curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms