Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 96 lines (85 sloc) 3.672 kb
b9b772f @yangtse pop3.c: fix compiler warning variable may be used uninitialized
yangtse authored
1 #ifndef HEADER_CURL_POP3_H
2 #define HEADER_CURL_POP3_H
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
3 /***************************************************************************
4 * _ _ ____ _
5 * Project ___| | | | _ \| |
6 * / __| | | | |_) | |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
9 *
e1ea18f @monnerat SASL: common URL option and auth capabilities decoders for all protocols
monnerat authored
10 * Copyright (C) 2009 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
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 http://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
e2201dc @captain-caveman2k pop3: Introduced a custom POP3 structure for per-request data
captain-caveman2k authored
25 #include "pingpong.h"
5f09cbc @monnerat IMAP/POP3/SMTP: use a per-connection sub-structure for SASL parameters.
monnerat authored
26 #include "curl_sasl.h"
e2201dc @captain-caveman2k pop3: Introduced a custom POP3 structure for per-request data
captain-caveman2k authored
27
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
28 /****************************************************************************
29 * POP3 unique setup
30 ***************************************************************************/
31 typedef enum {
c6495bc @captain-caveman2k pop3: Code tidy up before the introduction of authentication code
captain-caveman2k authored
32 POP3_STOP, /* do nothing state, stops the state machine */
33 POP3_SERVERGREET, /* waiting for the initial greeting immediately after
34 a connect */
85a2e9e @captain-caveman2k email: Post STARTLS capability code tidy up (Part One)
captain-caveman2k authored
35 POP3_CAPA,
a9d798c @captain-caveman2k pop3: Small code tidy up following authentication work so far
captain-caveman2k authored
36 POP3_STARTTLS,
4ffb8a6 @captain-caveman2k pop3: Added support for non-blocking SSL upgrade
captain-caveman2k authored
37 POP3_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS
38 (multi mode only) */
79543ca @monnerat SASL: common state engine for imap/pop3/smtp
monnerat authored
39 POP3_AUTH,
c09c621 @captain-caveman2k pop3: Added support for apop authentication
captain-caveman2k authored
40 POP3_APOP,
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
41 POP3_USER,
42 POP3_PASS,
15e1227 @captain-caveman2k pop3: Reworked the command sending and handling
captain-caveman2k authored
43 POP3_COMMAND,
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
44 POP3_QUIT,
c6495bc @captain-caveman2k pop3: Code tidy up before the introduction of authentication code
captain-caveman2k authored
45 POP3_LAST /* never used */
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
46 } pop3state;
47
e2201dc @captain-caveman2k pop3: Introduced a custom POP3 structure for per-request data
captain-caveman2k authored
48 /* This POP3 struct is used in the SessionHandle. All POP3 data that is
49 connection-oriented must be in pop3_conn to properly deal with the fact that
50 perhaps the SessionHandle is changed between the times the connection is
51 used. */
52 struct POP3 {
4afcb77 @captain-caveman2k pingpong: Renamed curl_ftptransfer to curl_pp_transfer
captain-caveman2k authored
53 curl_pp_transfer transfer;
e0cbfe8 @captain-caveman2k pop3: Refactored the mailbox variable as it didn't reflect it's purpose
captain-caveman2k authored
54 char *id; /* Message ID */
29a4a16 @captain-caveman2k pop3: Moved the per-request variables to the per-request data structure
captain-caveman2k authored
55 char *custom; /* Custom Request */
e2201dc @captain-caveman2k pop3: Introduced a custom POP3 structure for per-request data
captain-caveman2k authored
56 };
57
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
58 /* pop3_conn is used for struct connection-oriented data in the connectdata
59 struct */
60 struct pop3_conn {
61 struct pingpong pp;
aa44ec6 @captain-caveman2k email: Slight reordering of connection based variables
captain-caveman2k authored
62 pop3state state; /* Always use pop3.c:state() to change state! */
63 bool ssldone; /* Is connect() over SSL done? */
38dfe52 @captain-caveman2k pop3: Post authentication code tidy up
captain-caveman2k authored
64 size_t eob; /* Number of bytes of the EOB (End Of Body) that
65 have been received so far */
66 size_t strip; /* Number of bytes from the start to ignore as
67 non-body */
5f09cbc @monnerat IMAP/POP3/SMTP: use a per-connection sub-structure for SASL parameters.
monnerat authored
68 struct SASL sasl; /* SASL-related storage */
ecf93ac @captain-caveman2k pop3: Small consistency tidy up
captain-caveman2k authored
69 unsigned int authtypes; /* Accepted authentication types */
b3a01be @captain-caveman2k pop3: Added support for ;auth=<mech> in the URL
captain-caveman2k authored
70 unsigned int preftype; /* Preferred authentication type */
c09c621 @captain-caveman2k pop3: Added support for apop authentication
captain-caveman2k authored
71 char *apoptimestamp; /* APOP timestamp from the server greeting */
2f66ca1 @captain-caveman2k pop3: Added support for the STLS capability (Part One)
captain-caveman2k authored
72 bool tls_supported; /* StartTLS capability supported by server */
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
73 };
74
75 extern const struct Curl_handler Curl_handler_pop3;
76 extern const struct Curl_handler Curl_handler_pop3s;
77
4e430a8 @captain-caveman2k pop3: Enhanced the extended authentication mechanism detection
captain-caveman2k authored
78 /* Authentication type flags */
d956d9d @captain-caveman2k pop3: Reworked authentication type constants
captain-caveman2k authored
79 #define POP3_TYPE_CLEARTEXT (1 << 0)
80 #define POP3_TYPE_APOP (1 << 1)
81 #define POP3_TYPE_SASL (1 << 2)
4e430a8 @captain-caveman2k pop3: Enhanced the extended authentication mechanism detection
captain-caveman2k authored
82
b3a01be @captain-caveman2k pop3: Added support for ;auth=<mech> in the URL
captain-caveman2k authored
83 /* Authentication type values */
84 #define POP3_TYPE_NONE 0
b0b5b51 pop3: Fix POP3_TYPE_ANY signed compilation warning
Melissa Mears authored
85 #define POP3_TYPE_ANY ~0U
b3a01be @captain-caveman2k pop3: Added support for ;auth=<mech> in the URL
captain-caveman2k authored
86
c6495bc @captain-caveman2k pop3: Code tidy up before the introduction of authentication code
captain-caveman2k authored
87 /* This is the 5-bytes End-Of-Body marker for POP3 */
88 #define POP3_EOB "\x0d\x0a\x2e\x0d\x0a"
89 #define POP3_EOB_LEN 5
90
91 /* This function scans the body after the end-of-body and writes everything
92 * until the end is found */
93 CURLcode Curl_pop3_write(struct connectdata *conn, char *str, size_t nread);
ec3bb8f @bagder introducing IMAP, POP3 and SMTP support (still lots of polish left to do...
authored
94
b9b772f @yangtse pop3.c: fix compiler warning variable may be used uninitialized
yangtse authored
95 #endif /* HEADER_CURL_POP3_H */
Something went wrong with that request. Please try again.