1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_LOGIN_OPTIONS
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_PASSWORD (3)
9  - CURLOPT_USERNAME (3)
10Protocol:
11  - IMAP
12  - LDAP
13  - POP3
14  - SMTP
15Added-in: 7.34.0
16---
17
18# NAME
19
20CURLOPT_LOGIN_OPTIONS - login options
21
22# SYNOPSIS
23
24~~~c
25#include <curl/curl.h>
26
27CURLcode curl_easy_setopt(CURL *handle, CURLOPT_LOGIN_OPTIONS, char *options);
28~~~
29
30# DESCRIPTION
31
32Pass a char pointer as parameter, which should be pointing to the
33null-terminated *options* string to use for the transfer.
34
35For more information about the login options please see RFC 2384, RFC 5092 and
36the IETF draft **draft-earhart-url-smtp-00.txt**.
37
38CURLOPT_LOGIN_OPTIONS(3) can be used to set protocol specific login options,
39such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*",
40and should be used in conjunction with the CURLOPT_USERNAME(3) option.
41
42Since 8.2.0, IMAP supports the login option "AUTH=+LOGIN". With this option,
43curl uses the plain (not SASL) LOGIN IMAP command even if the server
44advertises SASL authentication. Care should be taken in using this option, as
45it sends your password in plain text. This does not work if the IMAP server
46disables the plain LOGIN (e.g. to prevent password snooping).
47
48The application does not have to keep the string around after setting this
49option.
50
51Using this option multiple times makes the last set string override the
52previous ones. Set it to NULL to disable its use again.
53
54# DEFAULT
55
56NULL
57
58# %PROTOCOLS%
59
60# EXAMPLE
61
62~~~c
63int main(void)
64{
65  CURL *curl = curl_easy_init();
66  if(curl) {
67    CURLcode res;
68    curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/");
69    curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, "AUTH=*");
70    res = curl_easy_perform(curl);
71    curl_easy_cleanup(curl);
72  }
73}
74~~~
75
76# HISTORY
77
78Support for OpenLDAP added in 7.82.0.
79
80# %AVAILABILITY%
81
82# RETURN VALUE
83
84Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
85CURLE_OUT_OF_MEMORY if there was insufficient heap space.
86