Commit | Line | Data |
---|---|---|
420a0d19 CE |
1 | /************************************************* |
2 | * Exim - an Internet mail transport agent * | |
3 | *************************************************/ | |
4 | ||
2ea97746 | 5 | /* Copyright (c) University of Cambridge 1995 - 2018 */ |
420a0d19 CE |
6 | /* See the file NOTICE for conditions of use and distribution. */ |
7 | ||
2ea97746 CE |
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 | ||
420a0d19 CE |
15 | /* Private structure for the private options and other private data. */ |
16 | ||
17 | typedef 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; | |
27 | uschar *dscp; | |
28 | uschar *serialize_hosts; | |
29 | uschar *hosts_try_auth; | |
30 | uschar *hosts_require_auth; | |
2ea97746 CE |
31 | uschar *hosts_try_chunking; |
32 | #ifdef SUPPORT_DANE | |
33 | uschar *hosts_try_dane; | |
34 | uschar *hosts_require_dane; | |
35 | uschar *dane_require_tls_ciphers; | |
36 | #endif | |
37 | uschar *hosts_try_fastopen; | |
420a0d19 CE |
38 | #ifndef DISABLE_PRDR |
39 | uschar *hosts_try_prdr; | |
40 | #endif | |
41 | #ifndef DISABLE_OCSP | |
42 | uschar *hosts_request_ocsp; | |
43 | uschar *hosts_require_ocsp; | |
44 | #endif | |
45 | uschar *hosts_require_tls; | |
46 | uschar *hosts_avoid_tls; | |
47 | uschar *hosts_verify_avoid_tls; | |
48 | uschar *hosts_avoid_pipelining; | |
2ea97746 CE |
49 | #ifdef EXPERIMENTAL_PIPE_CONNECT |
50 | uschar *hosts_pipe_connect; | |
51 | #endif | |
420a0d19 | 52 | uschar *hosts_avoid_esmtp; |
2ea97746 | 53 | #ifdef SUPPORT_TLS |
420a0d19 | 54 | uschar *hosts_nopass_tls; |
2ea97746 CE |
55 | uschar *hosts_noproxy_tls; |
56 | #endif | |
420a0d19 CE |
57 | int command_timeout; |
58 | int connect_timeout; | |
59 | int data_timeout; | |
60 | int final_timeout; | |
61 | int size_addition; | |
62 | int hosts_max_try; | |
63 | int hosts_max_try_hardlimit; | |
64 | BOOL address_retry_include_sender; | |
65 | BOOL allow_localhost; | |
66 | BOOL authenticated_sender_force; | |
67 | BOOL gethostbyname; | |
68 | BOOL dns_qualify_single; | |
69 | BOOL dns_search_parents; | |
2ea97746 | 70 | dnssec_domains dnssec; |
420a0d19 CE |
71 | BOOL delay_after_cutoff; |
72 | BOOL hosts_override; | |
73 | BOOL hosts_randomize; | |
74 | BOOL keepalive; | |
75 | BOOL lmtp_ignore_quota; | |
2ea97746 | 76 | uschar *expand_retry_include_ip_address; |
420a0d19 | 77 | BOOL retry_include_ip_address; |
2ea97746 CE |
78 | #ifdef SUPPORT_SOCKS |
79 | uschar *socks_proxy; | |
80 | #endif | |
420a0d19 CE |
81 | #ifdef SUPPORT_TLS |
82 | uschar *tls_certificate; | |
83 | uschar *tls_crl; | |
84 | uschar *tls_privatekey; | |
85 | uschar *tls_require_ciphers; | |
420a0d19 CE |
86 | uschar *tls_sni; |
87 | uschar *tls_verify_certificates; | |
88 | int tls_dh_min_bits; | |
89 | BOOL tls_tempfail_tryclear; | |
90 | uschar *tls_verify_hosts; | |
91 | uschar *tls_try_verify_hosts; | |
420a0d19 | 92 | uschar *tls_verify_cert_hostnames; |
2ea97746 CE |
93 | #endif |
94 | #ifdef SUPPORT_I18N | |
95 | uschar *utf8_downconvert; | |
420a0d19 CE |
96 | #endif |
97 | #ifndef DISABLE_DKIM | |
2ea97746 | 98 | struct ob_dkim dkim; |
420a0d19 | 99 | #endif |
2ea97746 CE |
100 | #ifdef EXPERIMENTAL_ARC |
101 | uschar *arc_sign; | |
420a0d19 CE |
102 | #endif |
103 | } smtp_transport_options_block; | |
104 | ||
2ea97746 CE |
105 | #define SOB (smtp_transport_options_block *) |
106 | ||
107 | ||
108 | /* smtp connect context */ | |
109 | typedef struct { | |
110 | uschar * from_addr; | |
111 | address_item * addrlist; | |
112 | ||
113 | smtp_connect_args conn_args; | |
114 | int port; | |
115 | ||
116 | BOOL verify:1; | |
117 | BOOL lmtp:1; | |
118 | BOOL smtps:1; | |
119 | BOOL ok:1; | |
120 | BOOL setting_up:1; | |
121 | #ifdef EXPERIMENTAL_PIPE_CONNECT | |
122 | BOOL early_pipe_ok:1; | |
123 | BOOL early_pipe_active:1; | |
124 | #endif | |
125 | BOOL esmtp:1; | |
126 | BOOL esmtp_sent:1; | |
127 | BOOL pipelining_used:1; | |
128 | #ifndef DISABLE_PRDR | |
129 | BOOL prdr_active:1; | |
130 | #endif | |
131 | #ifdef SUPPORT_I18N | |
132 | BOOL utf8_needed:1; | |
133 | #endif | |
134 | BOOL dsn_all_lasthop:1; | |
135 | #if defined(SUPPORT_TLS) && defined(SUPPORT_DANE) | |
136 | BOOL dane:1; | |
137 | BOOL dane_required:1; | |
138 | #endif | |
139 | #ifdef EXPERIMENTAL_PIPE_CONNECT | |
140 | BOOL pending_BANNER:1; | |
141 | BOOL pending_EHLO:1; | |
142 | #endif | |
143 | BOOL pending_MAIL:1; | |
144 | BOOL pending_BDAT:1; | |
145 | BOOL good_RCPT:1; | |
146 | BOOL completed_addr:1; | |
147 | BOOL send_rset:1; | |
148 | BOOL send_quit:1; | |
149 | ||
150 | int max_rcpt; | |
151 | int cmd_count; | |
152 | ||
153 | unsigned peer_offered; | |
154 | unsigned avoid_option; | |
155 | uschar * igquotstr; | |
156 | uschar * helo_data; | |
157 | #ifdef EXPERIMENTAL_DSN_INFO | |
158 | uschar * smtp_greeting; | |
159 | uschar * helo_response; | |
160 | #endif | |
161 | #ifdef EXPERIMENTAL_PIPE_CONNECT | |
162 | ehlo_resp_precis ehlo_resp; | |
163 | #endif | |
164 | ||
165 | address_item * first_addr; | |
166 | address_item * next_addr; | |
167 | address_item * sync_addr; | |
168 | ||
169 | client_conn_ctx cctx; | |
170 | smtp_inblock inblock; | |
171 | smtp_outblock outblock; | |
172 | uschar buffer[DELIVER_BUFFER_SIZE]; | |
173 | uschar inbuffer[4096]; | |
174 | uschar outbuffer[4096]; | |
175 | } smtp_context; | |
176 | ||
177 | extern int smtp_setup_conn(smtp_context *, BOOL); | |
178 | extern int smtp_write_mail_and_rcpt_cmds(smtp_context *, int *); | |
179 | extern int smtp_reap_early_pipe(smtp_context *, int *); | |
180 | ||
181 | ||
420a0d19 CE |
182 | /* Data for reading the private options. */ |
183 | ||
184 | extern optionlist smtp_transport_options[]; | |
185 | extern int smtp_transport_options_count; | |
186 | ||
187 | /* Block containing default values. */ | |
188 | ||
189 | extern smtp_transport_options_block smtp_transport_option_defaults; | |
190 | ||
191 | /* The main, init, and closedown entry points for the transport */ | |
192 | ||
193 | extern BOOL smtp_transport_entry(transport_instance *, address_item *); | |
194 | extern void smtp_transport_init(transport_instance *); | |
195 | extern void smtp_transport_closedown(transport_instance *); | |
196 | ||
197 | ||
198 | ||
420a0d19 CE |
199 | extern BOOL smtp_mail_auth_str(uschar *, unsigned, |
200 | address_item *, smtp_transport_options_block *); | |
201 | ||
2ea97746 CE |
202 | #ifdef SUPPORT_SOCKS |
203 | extern int socks_sock_connect(host_item *, int, int, uschar *, | |
204 | transport_instance *, int); | |
205 | #endif | |
206 | ||
420a0d19 | 207 | /* End of transports/smtp.h */ |