2012-12-28 19:03:09 +08:00
|
|
|
#ifndef HEADER_CURL_IMAP_H
|
|
|
|
#define HEADER_CURL_IMAP_H
|
2009-12-13 05:54:01 +08:00
|
|
|
/***************************************************************************
|
|
|
|
* _ _ ____ _
|
|
|
|
* Project ___| | | | _ \| |
|
|
|
|
* / __| | | | |_) | |
|
|
|
|
* | (__| |_| | _ <| |___
|
|
|
|
* \___|\___/|_| \_\_____|
|
|
|
|
*
|
2013-01-07 03:13:58 +08:00
|
|
|
* Copyright (C) 2009 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
|
2009-12-13 05:54:01 +08:00
|
|
|
*
|
|
|
|
* This software is licensed as described in the file COPYING, which
|
|
|
|
* you should have received as part of this distribution. The terms
|
|
|
|
* are also available at http://curl.haxx.se/docs/copyright.html.
|
|
|
|
*
|
|
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
***************************************************************************/
|
|
|
|
|
2013-01-04 09:50:28 +08:00
|
|
|
#include "pingpong.h"
|
2009-12-13 05:54:01 +08:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* IMAP unique setup
|
|
|
|
***************************************************************************/
|
|
|
|
typedef enum {
|
2012-12-29 03:59:14 +08:00
|
|
|
IMAP_STOP, /* do nothing state, stops the state machine */
|
|
|
|
IMAP_SERVERGREET, /* waiting for the initial greeting immediately after
|
|
|
|
a connect */
|
2013-02-11 05:18:30 +08:00
|
|
|
IMAP_CAPABILITY,
|
2009-12-13 05:54:01 +08:00
|
|
|
IMAP_STARTTLS,
|
2012-12-29 03:59:14 +08:00
|
|
|
IMAP_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS
|
|
|
|
(multi mode only) */
|
2013-01-07 06:25:14 +08:00
|
|
|
IMAP_AUTHENTICATE_PLAIN,
|
2013-01-07 07:14:18 +08:00
|
|
|
IMAP_AUTHENTICATE_LOGIN,
|
|
|
|
IMAP_AUTHENTICATE_LOGIN_PASSWD,
|
2013-01-07 15:35:49 +08:00
|
|
|
IMAP_AUTHENTICATE_CRAMMD5,
|
2013-01-07 19:01:05 +08:00
|
|
|
IMAP_AUTHENTICATE_DIGESTMD5,
|
|
|
|
IMAP_AUTHENTICATE_DIGESTMD5_RESP,
|
2013-01-07 10:47:12 +08:00
|
|
|
IMAP_AUTHENTICATE_NTLM,
|
|
|
|
IMAP_AUTHENTICATE_NTLM_TYPE2MSG,
|
2013-01-07 06:25:14 +08:00
|
|
|
IMAP_AUTHENTICATE,
|
2012-12-30 20:44:09 +08:00
|
|
|
IMAP_LOGIN,
|
2009-12-13 05:54:01 +08:00
|
|
|
IMAP_SELECT,
|
|
|
|
IMAP_FETCH,
|
|
|
|
IMAP_LOGOUT,
|
2012-12-29 03:59:14 +08:00
|
|
|
IMAP_LAST /* never used */
|
2009-12-13 05:54:01 +08:00
|
|
|
} imapstate;
|
|
|
|
|
|
|
|
/* imap_conn is used for struct connection-oriented data in the connectdata
|
|
|
|
struct */
|
|
|
|
struct imap_conn {
|
|
|
|
struct pingpong pp;
|
2013-02-06 07:59:47 +08:00
|
|
|
char *mailbox; /* Mailbox to select */
|
2013-01-07 03:13:58 +08:00
|
|
|
unsigned int authmechs; /* Accepted authentication mechanisms */
|
2013-01-07 06:25:14 +08:00
|
|
|
unsigned int authused; /* Auth mechanism used for the connection */
|
2013-01-07 03:13:58 +08:00
|
|
|
imapstate state; /* Always use imap.c:state() to change state! */
|
2013-02-07 06:22:57 +08:00
|
|
|
int cmdid; /* Last used command ID */
|
2013-02-07 08:18:23 +08:00
|
|
|
char resptag[5]; /* Response tag to wait for */
|
2013-01-26 23:06:44 +08:00
|
|
|
bool ssldone; /* Is connect() over SSL done? */
|
2013-02-10 20:13:55 +08:00
|
|
|
bool tls_supported; /* StartTLS capability supported by server */
|
2013-02-04 07:58:03 +08:00
|
|
|
bool login_disabled; /* LOGIN command explicitly disabled by server */
|
2013-02-08 04:02:06 +08:00
|
|
|
bool ir_supported; /* Initial response supported by server */
|
2009-12-13 05:54:01 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
extern const struct Curl_handler Curl_handler_imap;
|
|
|
|
extern const struct Curl_handler Curl_handler_imaps;
|
|
|
|
|
2012-12-28 19:03:09 +08:00
|
|
|
#endif /* HEADER_CURL_IMAP_H */
|