1 #ifndef HEADER_CURL_IMAP_H
2 #define HEADER_CURL_IMAP_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 2009 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
12 * This software is licensed as described in the file COPYING, which
13 * you should have received as part of this distribution. The terms
14 * are also available at http://curl.haxx.se/docs/copyright.html.
16 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17 * copies of the Software, and permit persons to whom the Software is
18 * furnished to do so, under the terms of the COPYING file.
20 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21 * KIND, either express or implied.
23 ***************************************************************************/
27 /****************************************************************************
29 ***************************************************************************/
31 IMAP_STOP, /* do nothing state, stops the state machine */
32 IMAP_SERVERGREET, /* waiting for the initial greeting immediately after
36 IMAP_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS
38 IMAP_AUTHENTICATE_PLAIN,
39 IMAP_AUTHENTICATE_LOGIN,
40 IMAP_AUTHENTICATE_LOGIN_PASSWD,
41 IMAP_AUTHENTICATE_CRAMMD5,
42 IMAP_AUTHENTICATE_DIGESTMD5,
43 IMAP_AUTHENTICATE_DIGESTMD5_RESP,
44 IMAP_AUTHENTICATE_NTLM,
45 IMAP_AUTHENTICATE_NTLM_TYPE2MSG,
46 IMAP_AUTHENTICATE_XOAUTH2,
47 IMAP_AUTHENTICATE_CANCEL,
48 IMAP_AUTHENTICATE_FINAL,
58 IMAP_LAST /* never used */
61 /* This IMAP struct is used in the SessionHandle. All IMAP data that is
62 connection-oriented must be in imap_conn to properly deal with the fact that
63 perhaps the SessionHandle is changed between the times the connection is
66 curl_pp_transfer transfer;
67 char *mailbox; /* Mailbox to select */
68 char *uidvalidity; /* UIDVALIDITY to check in select */
69 char *uid; /* Message UID to fetch */
70 char *section; /* Message SECTION to fetch */
71 char *partial; /* Message PARTIAL to fetch */
72 char *query; /* Query to search for */
73 char *custom; /* Custom request */
74 char *custom_params; /* Parameters for the custom request */
77 /* imap_conn is used for struct connection-oriented data in the connectdata
81 imapstate state; /* Always use imap.c:state() to change state! */
82 bool ssldone; /* Is connect() over SSL done? */
83 unsigned int authmechs; /* Accepted authentication mechanisms */
84 unsigned int preftype; /* Preferred authentication type */
85 unsigned int prefmech; /* Preferred authentication mechanism */
86 unsigned int authused; /* Auth mechanism used for the connection */
87 int cmdid; /* Last used command ID */
88 char resptag[5]; /* Response tag to wait for */
89 bool tls_supported; /* StartTLS capability supported by server */
90 bool login_disabled; /* LOGIN command disabled by server */
91 bool ir_supported; /* Initial response supported by server */
92 char *mailbox; /* The last selected mailbox */
93 char *mailbox_uidvalidity; /* UIDVALIDITY parsed from select response */
96 extern const struct Curl_handler Curl_handler_imap;
97 extern const struct Curl_handler Curl_handler_imaps;
99 /* Authentication type flags */
100 #define IMAP_TYPE_CLEARTEXT (1 << 0)
101 #define IMAP_TYPE_SASL (1 << 1)
103 /* Authentication type values */
104 #define IMAP_TYPE_NONE 0
105 #define IMAP_TYPE_ANY ~0U
107 #endif /* HEADER_CURL_IMAP_H */