Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
opt
cpr
opt
curl
lib
smtp.h
Go to the documentation of this file.
1
#ifndef HEADER_CURL_SMTP_H
2
#define HEADER_CURL_SMTP_H
3
/***************************************************************************
4
* _ _ ____ _
5
* Project ___| | | | _ \| |
6
* / __| | | | |_) | |
7
* | (__| |_| | _ <| |___
8
* \___|\___/|_| \_\_____|
9
*
10
* Copyright (C) 2009 - 2014, 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
* SMTP unique setup
30
***************************************************************************/
31
typedef
enum
{
32
SMTP_STOP
,
/* do nothing state, stops the state machine */
33
SMTP_SERVERGREET
,
/* waiting for the initial greeting immediately after
34
a connect */
35
SMTP_EHLO
,
36
SMTP_HELO
,
37
SMTP_STARTTLS
,
38
SMTP_UPGRADETLS
,
/* asynchronously upgrade the connection to SSL/TLS
39
(multi mode only) */
40
SMTP_AUTH
,
41
SMTP_COMMAND
,
/* VRFY, EXPN, NOOP, RSET and HELP */
42
SMTP_MAIL
,
/* MAIL FROM */
43
SMTP_RCPT
,
/* RCPT TO */
44
SMTP_DATA
,
45
SMTP_POSTDATA
,
46
SMTP_QUIT
,
47
SMTP_LAST
/* never used */
48
}
smtpstate
;
49
50
/* This SMTP struct is used in the Curl_easy. All SMTP data that is
51
connection-oriented must be in smtp_conn to properly deal with the fact that
52
perhaps the Curl_easy is changed between the times the connection is
53
used. */
54
struct
SMTP
{
55
curl_pp_transfer
transfer
;
56
char
*
custom
;
/* Custom Request */
57
struct
curl_slist
*
rcpt
;
/* Recipient list */
58
size_t
eob
;
/* Number of bytes of the EOB (End Of Body) that
59
have been received so far */
60
bool
trailing_crlf
;
/* Specifies if the tailing CRLF is present */
61
};
62
63
/* smtp_conn is used for struct connection-oriented data in the connectdata
64
struct */
65
struct
smtp_conn
{
66
struct
pingpong
pp;
67
smtpstate
state
;
/* Always use smtp.c:state() to change state! */
68
bool
ssldone
;
/* Is connect() over SSL done? */
69
char
*
domain
;
/* Client address/name to send in the EHLO */
70
struct
SASL
sasl;
/* SASL-related storage */
71
bool
tls_supported
;
/* StartTLS capability supported by server */
72
bool
size_supported
;
/* If server supports SIZE extension according to
73
RFC 1870 */
74
bool
auth_supported
;
/* AUTH capability supported by server */
75
};
76
77
extern
const
struct
Curl_handler
Curl_handler_smtp
;
78
extern
const
struct
Curl_handler
Curl_handler_smtps
;
79
80
/* this is the 5-bytes End-Of-Body marker for SMTP */
81
#define SMTP_EOB "\x0d\x0a\x2e\x0d\x0a"
82
#define SMTP_EOB_LEN 5
83
#define SMTP_EOB_FIND_LEN 3
84
85
/* if found in data, replace it with this string instead */
86
#define SMTP_EOB_REPL "\x0d\x0a\x2e\x2e"
87
#define SMTP_EOB_REPL_LEN 4
88
89
CURLcode
Curl_smtp_escape_eob
(
struct
connectdata
*conn,
const
ssize_t
nread);
90
91
#endif
/* HEADER_CURL_SMTP_H */
pingpong.h
SMTP::eob
size_t eob
Definition:
smtp.h:58
curl_slist
Definition:
curl.h:2335
curl_sasl.h
SMTP_QUIT
Definition:
smtp.h:46
smtp_conn
Definition:
smtp.h:65
Curl_handler_smtps
const struct Curl_handler Curl_handler_smtps
Curl_smtp_escape_eob
CURLcode Curl_smtp_escape_eob(struct connectdata *conn, const ssize_t nread)
Definition:
smtp.c:1533
smtp_conn::domain
char * domain
Definition:
smtp.h:69
CURLcode
CURLcode
Definition:
curl.h:454
SMTP_LAST
Definition:
smtp.h:47
SMTP_STOP
Definition:
smtp.h:32
SMTP::transfer
curl_pp_transfer transfer
Definition:
smtp.h:55
SMTP_SERVERGREET
Definition:
smtp.h:33
Curl_handler
Definition:
urldata.h:622
SMTP_MAIL
Definition:
smtp.h:42
smtp_conn::ssldone
bool ssldone
Definition:
smtp.h:68
SMTP_AUTH
Definition:
smtp.h:40
SMTP
Definition:
smtp.h:54
smtp_conn::tls_supported
bool tls_supported
Definition:
smtp.h:71
SMTP_COMMAND
Definition:
smtp.h:41
SMTP::trailing_crlf
bool trailing_crlf
Definition:
smtp.h:60
SMTP_DATA
Definition:
smtp.h:44
SASL
Definition:
curl_sasl.h:101
SMTP_UPGRADETLS
Definition:
smtp.h:38
ssize_t
#define ssize_t
Definition:
config-win32.h:382
SMTP::custom
char * custom
Definition:
smtp.h:56
SMTP::rcpt
struct curl_slist * rcpt
Definition:
smtp.h:57
smtp_conn::state
smtpstate state
Definition:
smtp.h:67
SMTP_STARTTLS
Definition:
smtp.h:37
SMTP_RCPT
Definition:
smtp.h:43
smtp_conn::auth_supported
bool auth_supported
Definition:
smtp.h:74
smtp_conn::size_supported
bool size_supported
Definition:
smtp.h:72
smtpstate
smtpstate
Definition:
smtp.h:31
Curl_handler_smtp
const struct Curl_handler Curl_handler_smtp
Definition:
smtp.c:113
pingpong
Definition:
pingpong.h:48
curl_pp_transfer
curl_pp_transfer
Definition:
pingpong.h:35
connectdata
Definition:
urldata.h:787
SMTP_POSTDATA
Definition:
smtp.h:45
SMTP_EHLO
Definition:
smtp.h:35
SMTP_HELO
Definition:
smtp.h:36
rc_tagdetect_client
Author(s): Monika Florek-Jasinska
, Raphael Schaller
autogenerated on Sat Feb 13 2021 03:42:16