Split out cutthrough connection-cache / subsequent-rcpt handling, from do_callout()
[exim.git] / src / src / transports / smtp.h
CommitLineData
0756eb3c
PH
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
3386088d 5/* Copyright (c) University of Cambridge 1995 - 2015 */
0756eb3c
PH
6/* See the file NOTICE for conditions of use and distribution. */
7
02b41d71
JH
8#define DELIVER_BUFFER_SIZE 4096
9
10#define PENDING 256
11#define PENDING_DEFER (PENDING + DEFER)
12#define PENDING_OK (PENDING + OK)
13
14
0756eb3c
PH
15/* Private structure for the private options and other private data. */
16
17typedef struct {
18 uschar *hosts;
19 uschar *fallback_hosts;
20 host_item *hostlist;
21 host_item *fallback_hostlist;
22 uschar *authenticated_sender;
23 uschar *helo_data;
24 uschar *interface;
25 uschar *port;
26 uschar *protocol;
9e4f5962 27 uschar *dscp;
0756eb3c
PH
28 uschar *serialize_hosts;
29 uschar *hosts_try_auth;
30 uschar *hosts_require_auth;
f98442df 31 uschar *hosts_try_chunking;
96e47838
TL
32#ifdef EXPERIMENTAL_DANE
33 uschar *hosts_try_dane;
7a31d643 34 uschar *hosts_require_dane;
96e47838 35#endif
fb05276a 36 uschar *hosts_try_fastopen;
8ccd00b1 37#ifndef DISABLE_PRDR
fd98a5c6
JH
38 uschar *hosts_try_prdr;
39#endif
f2de3a33 40#ifndef DISABLE_OCSP
44662487 41 uschar *hosts_request_ocsp;
f5d78688
JH
42 uschar *hosts_require_ocsp;
43#endif
0756eb3c
PH
44 uschar *hosts_require_tls;
45 uschar *hosts_avoid_tls;
99400968 46 uschar *hosts_verify_avoid_tls;
c51b8e75 47 uschar *hosts_avoid_pipelining;
0756eb3c
PH
48 uschar *hosts_avoid_esmtp;
49 uschar *hosts_nopass_tls;
50 int command_timeout;
51 int connect_timeout;
52 int data_timeout;
53 int final_timeout;
54 int size_addition;
55 int hosts_max_try;
8e669ac1 56 int hosts_max_try_hardlimit;
48c7f9e2 57 BOOL address_retry_include_sender;
0756eb3c 58 BOOL allow_localhost;
382afc6b 59 BOOL authenticated_sender_force;
0756eb3c
PH
60 BOOL gethostbyname;
61 BOOL dns_qualify_single;
62 BOOL dns_search_parents;
7cd171b7 63 dnssec_domains dnssec;
0756eb3c
PH
64 BOOL delay_after_cutoff;
65 BOOL hosts_override;
66 BOOL hosts_randomize;
67 BOOL keepalive;
f1513293 68 BOOL lmtp_ignore_quota;
9c695f6d 69 uschar *expand_retry_include_ip_address;
0756eb3c 70 BOOL retry_include_ip_address;
f0989ec0 71#ifdef SUPPORT_SOCKS
7eb6c37c
JH
72 uschar *socks_proxy;
73#endif
e51c7be2 74#ifdef SUPPORT_TLS
0756eb3c
PH
75 uschar *tls_certificate;
76 uschar *tls_crl;
77 uschar *tls_privatekey;
78 uschar *tls_require_ciphers;
54c90be1 79 uschar *tls_sni;
0756eb3c 80 uschar *tls_verify_certificates;
54c90be1 81 int tls_dh_min_bits;
0756eb3c 82 BOOL tls_tempfail_tryclear;
a63be306
WB
83 uschar *tls_verify_hosts;
84 uschar *tls_try_verify_hosts;
e51c7be2 85 uschar *tls_verify_cert_hostnames;
e51c7be2
JH
86#endif
87#ifndef DISABLE_DKIM
ff5aac2b 88 struct ob_dkim dkim;
e51c7be2 89#endif
0756eb3c
PH
90} smtp_transport_options_block;
91
02b41d71
JH
92/* smtp connect context */
93typedef struct {
94 address_item * addrlist;
95 host_item * host;
96 int host_af;
97 int port;
98 uschar * interface;
99
100 BOOL lmtp:1;
101 BOOL smtps:1;
102 BOOL ok:1;
103 BOOL send_rset:1;
104 BOOL send_quit:1;
105 BOOL setting_up:1;
106 BOOL esmtp:1;
107 BOOL esmtp_sent:1;
108 BOOL pending_MAIL:1;
109#ifndef DISABLE_PRDR
110 BOOL prdr_active:1;
111#endif
112#ifdef SUPPORT_I18N
113 BOOL utf8_needed:1;
114#endif
115 BOOL dsn_all_lasthop:1;
116#if defined(SUPPORT_TLS) && defined(EXPERIMENTAL_DANE)
117 BOOL dane:1;
118 BOOL dane_required:1;
119#endif
120
121 int max_rcpt;
122
123 uschar peer_offered;
124 uschar * igquotstr;
125 uschar * helo_data;
126#ifdef EXPERIMENTAL_DSN_INFO
127 uschar * smtp_greeting;
128 uschar * helo_response;
129#endif
130
131 smtp_inblock inblock;
132 smtp_outblock outblock;
133 uschar buffer[DELIVER_BUFFER_SIZE];
134 uschar inbuffer[4096];
135 uschar outbuffer[4096];
136
137 transport_instance * tblock;
138 smtp_transport_options_block * ob;
139} smtp_context;
140
141extern int smtp_setup_conn(smtp_context *, BOOL, BOOL);
142
143
0756eb3c
PH
144/* Data for reading the private options. */
145
146extern optionlist smtp_transport_options[];
147extern int smtp_transport_options_count;
148
149/* Block containing default values. */
150
151extern smtp_transport_options_block smtp_transport_option_defaults;
152
153/* The main, init, and closedown entry points for the transport */
154
155extern BOOL smtp_transport_entry(transport_instance *, address_item *);
156extern void smtp_transport_init(transport_instance *);
157extern void smtp_transport_closedown(transport_instance *);
158
b4a2b536
JH
159
160
161extern int smtp_auth(uschar *, unsigned, address_item *, host_item *,
162 smtp_transport_options_block *, BOOL,
163 smtp_inblock *, smtp_outblock *);
164extern BOOL smtp_mail_auth_str(uschar *, unsigned,
165 address_item *, smtp_transport_options_block *);
166
f0989ec0 167#ifdef SUPPORT_SOCKS
160ef8ca 168extern int socks_sock_connect(host_item *, int, int, uschar *,
7eb6c37c
JH
169 transport_instance *, int);
170#endif
171
0756eb3c 172/* End of transports/smtp.h */