1 #ifndef HEADER_CURL_SMTP_H
2 #define HEADER_CURL_SMTP_H
3 /***************************************************************************
5 * Project ___| | | | _ \| |
7 * | (__| |_| | _ <| |___
8 * \___|\___/|_| \_\_____|
10 * Copyright (C) 2009 - 2013, 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 SMTP_STOP, /* do nothing state, stops the state machine */
32 SMTP_SERVERGREET, /* waiting for the initial greeting immediately after
37 SMTP_UPGRADETLS, /* asynchronously upgrade the connection to SSL/TLS
41 SMTP_AUTH_LOGIN_PASSWD,
44 SMTP_AUTH_DIGESTMD5_RESP,
46 SMTP_AUTH_NTLM_TYPE2MSG,
50 SMTP_MAIL, /* MAIL FROM */
51 SMTP_RCPT, /* RCPT TO */
55 SMTP_LAST /* never used */
58 /* This SMTP struct is used in the SessionHandle. All SMTP data that is
59 connection-oriented must be in smtp_conn to properly deal with the fact that
60 perhaps the SessionHandle is changed between the times the connection is
63 curl_pp_transfer transfer;
64 struct curl_slist *rcpt; /* Recipient list */
65 size_t eob; /* Number of bytes of the EOB (End Of Body) that
66 have been received so far */
67 bool trailing_crlf; /* Specifies if the tailing CRLF is present */
70 /* smtp_conn is used for struct connection-oriented data in the connectdata
74 smtpstate state; /* Always use smtp.c:state() to change state! */
75 bool ssldone; /* Is connect() over SSL done? */
76 char *domain; /* Client address/name to send in the EHLO */
77 unsigned int authmechs; /* Accepted authentication mechanisms */
78 unsigned int prefmech; /* Preferred authentication mechanism */
79 unsigned int authused; /* Auth mechanism used for the connection */
80 bool tls_supported; /* StartTLS capability supported by server */
81 bool size_supported; /* If server supports SIZE extension according to
85 extern const struct Curl_handler Curl_handler_smtp;
86 extern const struct Curl_handler Curl_handler_smtps;
88 /* this is the 5-bytes End-Of-Body marker for SMTP */
89 #define SMTP_EOB "\x0d\x0a\x2e\x0d\x0a"
90 #define SMTP_EOB_LEN 5
91 #define SMTP_EOB_FIND_LEN 3
93 /* if found in data, replace it with this string instead */
94 #define SMTP_EOB_REPL "\x0d\x0a\x2e\x2e"
95 #define SMTP_EOB_REPL_LEN 4
97 CURLcode Curl_smtp_escape_eob(struct connectdata *conn, ssize_t nread);
99 #endif /* HEADER_CURL_SMTP_H */