DANE: smtp transport option dane_require_tls_ciphers
[exim.git] / src / src / transports / smtp.h
1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
4
5 /* Copyright (c) University of Cambridge 1995 - 2018 */
6 /* See the file NOTICE for conditions of use and distribution. */
7
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
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;
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;
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;
49 uschar *hosts_avoid_esmtp;
50 #ifdef SUPPORT_TLS
51 uschar *hosts_nopass_tls;
52 uschar *hosts_noproxy_tls;
53 #endif
54 int command_timeout;
55 int connect_timeout;
56 int data_timeout;
57 int final_timeout;
58 int size_addition;
59 int hosts_max_try;
60 int hosts_max_try_hardlimit;
61 BOOL address_retry_include_sender;
62 BOOL allow_localhost;
63 BOOL authenticated_sender_force;
64 BOOL gethostbyname;
65 BOOL dns_qualify_single;
66 BOOL dns_search_parents;
67 dnssec_domains dnssec;
68 BOOL delay_after_cutoff;
69 BOOL hosts_override;
70 BOOL hosts_randomize;
71 BOOL keepalive;
72 BOOL lmtp_ignore_quota;
73 uschar *expand_retry_include_ip_address;
74 BOOL retry_include_ip_address;
75 #ifdef SUPPORT_SOCKS
76 uschar *socks_proxy;
77 #endif
78 #ifdef SUPPORT_TLS
79 uschar *tls_certificate;
80 uschar *tls_crl;
81 uschar *tls_privatekey;
82 uschar *tls_require_ciphers;
83 uschar *tls_sni;
84 uschar *tls_verify_certificates;
85 int tls_dh_min_bits;
86 BOOL tls_tempfail_tryclear;
87 uschar *tls_verify_hosts;
88 uschar *tls_try_verify_hosts;
89 uschar *tls_verify_cert_hostnames;
90 #endif
91 #ifndef DISABLE_DKIM
92 struct ob_dkim dkim;
93 #endif
94 #ifdef EXPERIMENTAL_ARC
95 uschar *arc_sign;
96 #endif
97 } smtp_transport_options_block;
98
99 /* smtp connect context */
100 typedef struct {
101 uschar * from_addr;
102 address_item * addrlist;
103 host_item * host;
104 int host_af;
105 int port;
106 uschar * interface;
107
108 BOOL verify:1;
109 BOOL lmtp:1;
110 BOOL smtps:1;
111 BOOL ok:1;
112 BOOL setting_up:1;
113 BOOL esmtp:1;
114 BOOL esmtp_sent:1;
115 #ifndef DISABLE_PRDR
116 BOOL prdr_active:1;
117 #endif
118 #ifdef SUPPORT_I18N
119 BOOL utf8_needed:1;
120 #endif
121 BOOL dsn_all_lasthop:1;
122 #if defined(SUPPORT_TLS) && defined(SUPPORT_DANE)
123 BOOL dane:1;
124 BOOL dane_required:1;
125 #endif
126 BOOL pending_MAIL:1;
127 BOOL pending_BDAT:1;
128 BOOL good_RCPT:1;
129 BOOL completed_addr:1;
130 BOOL send_rset:1;
131 BOOL send_quit:1;
132
133 int max_rcpt;
134 int cmd_count;
135
136 uschar peer_offered;
137 uschar avoid_option;
138 uschar * igquotstr;
139 uschar * helo_data;
140 #ifdef EXPERIMENTAL_DSN_INFO
141 uschar * smtp_greeting;
142 uschar * helo_response;
143 #endif
144
145 address_item * first_addr;
146 address_item * next_addr;
147 address_item * sync_addr;
148
149 smtp_inblock inblock;
150 smtp_outblock outblock;
151 uschar buffer[DELIVER_BUFFER_SIZE];
152 uschar inbuffer[4096];
153 uschar outbuffer[4096];
154
155 transport_instance * tblock;
156 smtp_transport_options_block * ob;
157 } smtp_context;
158
159 extern int smtp_setup_conn(smtp_context *, BOOL);
160 extern int smtp_write_mail_and_rcpt_cmds(smtp_context *, int *);
161
162
163 /* Data for reading the private options. */
164
165 extern optionlist smtp_transport_options[];
166 extern int smtp_transport_options_count;
167
168 /* Block containing default values. */
169
170 extern smtp_transport_options_block smtp_transport_option_defaults;
171
172 /* The main, init, and closedown entry points for the transport */
173
174 extern BOOL smtp_transport_entry(transport_instance *, address_item *);
175 extern void smtp_transport_init(transport_instance *);
176 extern void smtp_transport_closedown(transport_instance *);
177
178
179
180 extern int smtp_auth(uschar *, unsigned, address_item *, host_item *,
181 smtp_transport_options_block *, BOOL,
182 smtp_inblock *, smtp_outblock *);
183 extern BOOL smtp_mail_auth_str(uschar *, unsigned,
184 address_item *, smtp_transport_options_block *);
185
186 #ifdef SUPPORT_SOCKS
187 extern int socks_sock_connect(host_item *, int, int, uschar *,
188 transport_instance *, int);
189 #endif
190
191 /* End of transports/smtp.h */