GNURLOPT_M...LLLOWFAILS(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸ’Œ NAME

GNURLOPT_M...LLLOWFAILS(3) bestie β€” it's a page from the curl_easy_setopt options manual, and it's all about CURLOPT_MAIL_RCPT_ALLLOWFAILS, the option that lets the RCPT TO command fail for some recipients without the whole thing going up in flames πŸ’…βœ¨

✨ SYNOPSIS

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAIL_RCPT_ALLLOWFAILS,
                          long allow);

πŸ’… DESCRIPTION

So like, if allow is set to 1L, you're basically telling curl "hey, it's fine if the RCPT TO command fails for some recipients, no biggie" 🫢

When you're sending data to multiple recipients, the default vibe is that curl will abort the SMTP conversation if at least one of the recipients makes the RCPT TO command return an error. Like, one bad apple and the whole thing's over 😭

But you can change that default behavior by setting ignore to 1L, which makes curl lowkey ignore those errors and keep it moving with the remaining valid recipients. Slay πŸ’–

And in the case where all recipients cause the RCPT TO command to fail? Yeah, curl's gonna abort the SMTP conversation and return the error received from the last RCPT TO command. Periodt πŸ’€

πŸŽ€ DEFAULT

0

🌸 PROTOCOLS

SMTP β€” that's it, that's the whole list πŸ¦‹

πŸ¦‹ 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);
}

⭐ AVAILABILITY

Added in 7.69.0 β€” so it's been iconic for a minute now, iykyk πŸ‘‘

πŸ”₯ RETURN VALUE

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. That's the whole vibe check 🌈

πŸ’œ SEE ALSO


okay that's the whole page bestie, go forth and send emails responsibly πŸ§šβ€β™€οΈβœ¨ β€” this lil rewrite is from the libcurl 7.69.0 manual, dated 16 Jan 2020, and it's the GNURLOPT_M...LLLOWFAILS(3) page, mwah πŸ’‹πŸŒΈ

πŸ“¦ where this page comes from