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 15--- 16 17# NAME 18 19CURLOPT_LOGIN_OPTIONS - login options 20 21# SYNOPSIS 22 23~~~c 24#include <curl/curl.h> 25 26CURLcode curl_easy_setopt(CURL *handle, CURLOPT_LOGIN_OPTIONS, char *options); 27~~~ 28 29# DESCRIPTION 30 31Pass a char pointer as parameter, which should be pointing to the 32null-terminated *options* string to use for the transfer. 33 34For more information about the login options please see RFC 2384, RFC 5092 and 35the IETF draft **draft-earhart-url-smtp-00.txt**. 36 37CURLOPT_LOGIN_OPTIONS(3) can be used to set protocol specific login options, 38such as the preferred authentication mechanism via "AUTH=NTLM" or "AUTH=*", 39and should be used in conjunction with the CURLOPT_USERNAME(3) option. 40 41Since 8.2.0, IMAP supports the login option "AUTH=+LOGIN". With this option, 42curl uses the plain (not SASL) LOGIN IMAP command even if the server 43advertises SASL authentication. Care should be taken in using this option, as 44it sends your password in plain text. This does not work if the IMAP server 45disables the plain LOGIN (e.g. to prevent password snooping). 46 47The application does not have to keep the string around after setting this 48option. 49 50# DEFAULT 51 52NULL 53 54# EXAMPLE 55 56~~~c 57int main(void) 58{ 59 CURL *curl = curl_easy_init(); 60 if(curl) { 61 CURLcode res; 62 curl_easy_setopt(curl, CURLOPT_URL, "smtp://example.com/"); 63 curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, "AUTH=*"); 64 res = curl_easy_perform(curl); 65 curl_easy_cleanup(curl); 66 } 67} 68~~~ 69 70# AVAILABILITY 71 72Added in 7.34.0. Support for OpenLDAP added in 7.82.0. 73 74# RETURN VALUE 75 76Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or 77CURLE_OUT_OF_MEMORY if there was insufficient heap space. 78