CURLOPT_SASL_IR(3)

okay so literally welcome to the libcurl Library Functions Manual, bestie β€” today’s main character is CURLOPT_SASL_IR(3), and it’s giving β€œsend initial response in first packet” energy. πŸ’…βœ¨

πŸŽ€ NAME πŸŽ€

CURLOPT_SASL_IR β€” send initial response in first packet

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SASL_IR, long enable);

πŸ’– DESCRIPTION πŸ’–

You pass a long. If the value is 1, curl sends the initial response to the server in the first authentication packet in order to reduce the number of ping pong requests. No cap, it’s just trying to make auth less back-and-forth. 😭✨

Only applicable to the following supporting SASL authentication mechanisms:

  • Login
  • Plain
  • GSSAPI
  • NTLM
  • OAuth 2.0
πŸ’‘ Note: Whilst IMAP supports this option there is no need to explicitly set it, as libcurl can determine the feature itself when the server supports the SASL-IR CAPABILITY. So like… it already knows, bestie. 🫢

🌸 DEFAULT 🌸

0

🌈 PROTOCOLS 🌈

This functionality affects imap and smtp.

✨ EXAMPLE ✨

Here’s the lil code moment, bestie β€” copy it exactly, no cap:

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_SASL_IR, 1L);
    result = curl_easy_perform(curl);
    curl_easy_cleanup(curl);
  }
}

🧚 AVAILABILITY 🧚

Added in curl 7.31.0.

πŸ‘‘ 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 came from libcurl, dated 2026-10-12, and the footer vibes are literally CURLOPT_SASL_IR(3). Bye bestie, go slay your SASL auth! πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from