xref: /curl/docs/libcurl/opts/CURLOPT_SASL_IR.md (revision 5a488251)
1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SASL_IR
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_MAIL_AUTH (3)
9  - CURLOPT_MAIL_FROM (3)
10  - CURLOPT_SASL_AUTHZID (3)
11Protocol:
12  - SMTP
13  - IMAP
14Added-in: 7.31.0
15---
16
17# NAME
18
19CURLOPT_SASL_IR - send initial response in first packet
20
21# SYNOPSIS
22
23~~~c
24#include <curl/curl.h>
25
26CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SASL_IR, long enable);
27~~~
28
29# DESCRIPTION
30
31Pass a long. If the value is 1, curl sends the initial response to the server
32in the first authentication packet in order to reduce the number of ping pong
33requests. Only applicable to the following supporting SASL authentication
34mechanisms:
35
36* Login
37* Plain
38* GSSAPI
39* NTLM
40* OAuth 2.0
41
42Note: Whilst IMAP supports this option there is no need to explicitly set it,
43as libcurl can determine the feature itself when the server supports the
44SASL-IR CAPABILITY.
45
46# DEFAULT
47
480
49
50# %PROTOCOLS%
51
52# EXAMPLE
53
54~~~c
55int main(void)
56{
57  CURL *curl = curl_easy_init();
58  if(curl) {
59    CURLcode res;
60    curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
61    curl_easy_setopt(curl, CURLOPT_SASL_IR, 1L);
62    res = curl_easy_perform(curl);
63    curl_easy_cleanup(curl);
64  }
65}
66~~~
67
68# %AVAILABILITY%
69
70# RETURN VALUE
71
72Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
73