Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
opt
cpr
opt
curl
lib
imap.h
Go to the documentation of this file.
1
#ifndef HEADER_CURL_IMAP_H
2
#define HEADER_CURL_IMAP_H
3
/***************************************************************************
4
* _ _ ____ _
5
* Project ___| | | | _ \| |
6
* / __| | | | |_) | |
7
* | (__| |_| | _ <| |___
8
* \___|\___/|_| \_\_____|
9
*
10
* Copyright (C) 2009 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
11
*
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 https://curl.haxx.se/docs/copyright.html.
15
*
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.
19
*
20
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21
* KIND, either express or implied.
22
*
23
***************************************************************************/
24
25
#include "
pingpong.h
"
26
#include "
curl_sasl.h
"
27
28
/****************************************************************************
29
* IMAP unique setup
30
***************************************************************************/
31
typedef
enum
{
32
IMAP_STOP
,
/* do nothing state, stops the state machine */
33
IMAP_SERVERGREET
,
/* waiting for the initial greeting immediately after
34
a connect */
35
IMAP_CAPABILITY
,
36
IMAP_STARTTLS
,
37
IMAP_UPGRADETLS
,
/* asynchronously upgrade the connection to SSL/TLS
38
(multi mode only) */
39
IMAP_AUTHENTICATE
,
40
IMAP_LOGIN
,
41
IMAP_LIST
,
42
IMAP_SELECT
,
43
IMAP_FETCH
,
44
IMAP_FETCH_FINAL
,
45
IMAP_APPEND
,
46
IMAP_APPEND_FINAL
,
47
IMAP_SEARCH
,
48
IMAP_LOGOUT
,
49
IMAP_LAST
/* never used */
50
}
imapstate
;
51
52
/* This IMAP struct is used in the Curl_easy. All IMAP data that is
53
connection-oriented must be in imap_conn to properly deal with the fact that
54
perhaps the Curl_easy is changed between the times the connection is
55
used. */
56
struct
IMAP
{
57
curl_pp_transfer
transfer
;
58
char
*
mailbox
;
/* Mailbox to select */
59
char
*
uidvalidity
;
/* UIDVALIDITY to check in select */
60
char
*
uid
;
/* Message UID to fetch */
61
char
*
section
;
/* Message SECTION to fetch */
62
char
*
partial
;
/* Message PARTIAL to fetch */
63
char
*
query
;
/* Query to search for */
64
char
*
custom
;
/* Custom request */
65
char
*
custom_params
;
/* Parameters for the custom request */
66
};
67
68
/* imap_conn is used for struct connection-oriented data in the connectdata
69
struct */
70
struct
imap_conn
{
71
struct
pingpong
pp;
72
imapstate
state
;
/* Always use imap.c:state() to change state! */
73
bool
ssldone
;
/* Is connect() over SSL done? */
74
bool
preauth
;
/* Is this connection PREAUTH? */
75
struct
SASL
sasl;
/* SASL-related parameters */
76
unsigned
int
preftype
;
/* Preferred authentication type */
77
int
cmdid
;
/* Last used command ID */
78
char
resptag[5];
/* Response tag to wait for */
79
bool
tls_supported
;
/* StartTLS capability supported by server */
80
bool
login_disabled
;
/* LOGIN command disabled by server */
81
bool
ir_supported
;
/* Initial response supported by server */
82
char
*
mailbox
;
/* The last selected mailbox */
83
char
*
mailbox_uidvalidity
;
/* UIDVALIDITY parsed from select response */
84
};
85
86
extern
const
struct
Curl_handler
Curl_handler_imap
;
87
extern
const
struct
Curl_handler
Curl_handler_imaps
;
88
89
/* Authentication type flags */
90
#define IMAP_TYPE_CLEARTEXT (1 << 0)
91
#define IMAP_TYPE_SASL (1 << 1)
92
93
/* Authentication type values */
94
#define IMAP_TYPE_NONE 0
95
#define IMAP_TYPE_ANY ~0U
96
97
#endif
/* HEADER_CURL_IMAP_H */
IMAP_SEARCH
Definition:
imap.h:47
IMAP::query
char * query
Definition:
imap.h:63
pingpong.h
imap_conn::login_disabled
bool login_disabled
Definition:
imap.h:80
curl_sasl.h
IMAP::partial
char * partial
Definition:
imap.h:62
imap_conn::preauth
bool preauth
Definition:
imap.h:74
IMAP_LOGIN
Definition:
imap.h:40
imap_conn::cmdid
int cmdid
Definition:
imap.h:77
IMAP::uidvalidity
char * uidvalidity
Definition:
imap.h:59
Curl_handler
Definition:
urldata.h:622
IMAP::transfer
curl_pp_transfer transfer
Definition:
imap.h:57
IMAP_STOP
Definition:
imap.h:32
IMAP_UPGRADETLS
Definition:
imap.h:37
IMAP
Definition:
imap.h:56
IMAP::uid
char * uid
Definition:
imap.h:60
IMAP_APPEND_FINAL
Definition:
imap.h:46
IMAP::custom
char * custom
Definition:
imap.h:64
IMAP_CAPABILITY
Definition:
imap.h:35
IMAP_SELECT
Definition:
imap.h:42
Curl_handler_imap
const struct Curl_handler Curl_handler_imap
Definition:
imap.c:117
IMAP_LOGOUT
Definition:
imap.h:48
IMAP_LIST
Definition:
imap.h:41
IMAP_AUTHENTICATE
Definition:
imap.h:39
IMAP_FETCH_FINAL
Definition:
imap.h:44
imap_conn::mailbox_uidvalidity
char * mailbox_uidvalidity
Definition:
imap.h:83
IMAP_FETCH
Definition:
imap.h:43
imap_conn::tls_supported
bool tls_supported
Definition:
imap.h:79
imap_conn::mailbox
char * mailbox
Definition:
imap.h:82
IMAP::mailbox
char * mailbox
Definition:
imap.h:58
IMAP::section
char * section
Definition:
imap.h:61
SASL
Definition:
curl_sasl.h:101
imap_conn
Definition:
imap.h:70
IMAP::custom_params
char * custom_params
Definition:
imap.h:65
imap_conn::ssldone
bool ssldone
Definition:
imap.h:73
imapstate
imapstate
Definition:
imap.h:31
imap_conn::preftype
unsigned int preftype
Definition:
imap.h:76
imap_conn::ir_supported
bool ir_supported
Definition:
imap.h:81
Curl_handler_imaps
const struct Curl_handler Curl_handler_imaps
pingpong
Definition:
pingpong.h:48
curl_pp_transfer
curl_pp_transfer
Definition:
pingpong.h:35
imap_conn::state
imapstate state
Definition:
imap.h:72
IMAP_SERVERGREET
Definition:
imap.h:33
IMAP_STARTTLS
Definition:
imap.h:36
IMAP_LAST
Definition:
imap.h:49
IMAP_APPEND
Definition:
imap.h:45
rc_tagdetect_client
Author(s): Monika Florek-Jasinska
, Raphael Schaller
autogenerated on Sat Feb 13 2021 03:42:15