Add gnutls_enable_pkcs11 option.
[exim.git] / src / src / globals.c
CommitLineData
059ec3d9
PH
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
c4ceed07 5/* Copyright (c) University of Cambridge 1995 - 2012 */
059ec3d9
PH
6/* See the file NOTICE for conditions of use and distribution. */
7
8/* All the global variables are defined together in this one module, so
9that they are easy to find. */
10
11#include "exim.h"
12
13
059ec3d9
PH
14/* Generic options for auths, all of which live inside auth_instance
15data blocks and hence have the opt_public flag set. */
16
17optionlist optionlist_auths[] = {
6c512171
PH
18 { "client_condition", opt_stringptr | opt_public,
19 (void *)(offsetof(auth_instance, client_condition)) },
059ec3d9
PH
20 { "driver", opt_stringptr | opt_public,
21 (void *)(offsetof(auth_instance, driver_name)) },
22 { "public_name", opt_stringptr | opt_public,
23 (void *)(offsetof(auth_instance, public_name)) },
24 { "server_advertise_condition", opt_stringptr | opt_public,
25 (void *)(offsetof(auth_instance, advertise_condition))},
16ff981e
PH
26 { "server_condition", opt_stringptr | opt_public,
27 (void *)(offsetof(auth_instance, server_condition)) },
059ec3d9
PH
28 { "server_debug_print", opt_stringptr | opt_public,
29 (void *)(offsetof(auth_instance, server_debug_string)) },
30 { "server_mail_auth_condition", opt_stringptr | opt_public,
31 (void *)(offsetof(auth_instance, mail_auth_condition)) },
32 { "server_set_id", opt_stringptr | opt_public,
33 (void *)(offsetof(auth_instance, set_id)) }
34};
35
36int optionlist_auths_size = sizeof(optionlist_auths)/sizeof(optionlist);
37
38/* An empty host aliases list. */
39
40uschar *no_aliases = NULL;
41
42
43/* For comments on these variables, see globals.h. I'm too idle to
44duplicate them here... */
45
46#ifdef EXIM_PERL
47uschar *opt_perl_startup = NULL;
48BOOL opt_perl_at_start = FALSE;
49BOOL opt_perl_started = FALSE;
50#endif
51
1a46a8c5
PH
52#ifdef EXPAND_DLFUNC
53tree_node *dlobj_anchor = NULL;
54#endif
55
059ec3d9
PH
56#ifdef LOOKUP_IBASE
57uschar *ibase_servers = NULL;
58#endif
59
60#ifdef LOOKUP_LDAP
bc19a55b
PP
61uschar *eldap_ca_cert_dir = NULL;
62uschar *eldap_ca_cert_file = NULL;
63uschar *eldap_cert_file = NULL;
64uschar *eldap_cert_key = NULL;
65uschar *eldap_cipher_suite = NULL;
059ec3d9 66uschar *eldap_default_servers = NULL;
bc19a55b 67uschar *eldap_require_cert = NULL;
059ec3d9 68int eldap_version = -1;
bc19a55b 69BOOL eldap_start_tls = FALSE;
059ec3d9
PH
70#endif
71
72#ifdef LOOKUP_MYSQL
73uschar *mysql_servers = NULL;
74#endif
75
76#ifdef LOOKUP_ORACLE
77uschar *oracle_servers = NULL;
78#endif
79
80#ifdef LOOKUP_PGSQL
81uschar *pgsql_servers = NULL;
82#endif
83
31480e42
PH
84#ifdef LOOKUP_SQLITE
85int sqlite_lock_timeout = 5;
86#endif
87
059ec3d9
PH
88#ifdef SUPPORT_MOVE_FROZEN_MESSAGES
89BOOL move_frozen_messages = FALSE;
90#endif
91
92/* These variables are outside the #ifdef because it keeps the code less
93cluttered in several places (e.g. during logging) if we can always refer to
94them. Also, the tls_ variables are now always visible. */
95
817d9f57
JH
96tls_support tls_in = {
97 -1, /* tls_active */
98 0, /* tls_bits */
99 FALSE,/* tls_certificate_verified */
100 NULL, /* tls_cipher */
101 FALSE,/* tls_on_connect */
102 NULL, /* tls_on_connect_ports */
103 NULL, /* tls_peerdn */
104 NULL /* tls_sni */
105};
106tls_support tls_out = {
107 -1, /* tls_active */
108 0, /* tls_bits */
109 FALSE,/* tls_certificate_verified */
110 NULL, /* tls_cipher */
111 FALSE,/* tls_on_connect */
112 NULL, /* tls_on_connect_ports */
113 NULL, /* tls_peerdn */
114 NULL /* tls_sni */
115};
116
059ec3d9
PH
117
118#ifdef SUPPORT_TLS
e6060e2c 119BOOL gnutls_compat_mode = FALSE;
a5f239e4 120BOOL gnutls_enable_pkcs11 = FALSE;
83da1223
PH
121uschar *gnutls_require_mac = NULL;
122uschar *gnutls_require_kx = NULL;
123uschar *gnutls_require_proto = NULL;
77bb000f 124uschar *openssl_options = NULL;
059ec3d9
PH
125const pcre *regex_STARTTLS = NULL;
126uschar *tls_advertise_hosts = NULL; /* This is deliberate */
127uschar *tls_certificate = NULL;
128uschar *tls_crl = NULL;
3375e053
PP
129/* This default matches NSS DH_MAX_P_BITS value at current time (2012), because
130that's the interop problem which has been observed: GnuTLS suggesting a higher
131bit-count as "NORMAL" (2432) and Thunderbird dropping connection. */
132int tls_dh_max_bits = 2236;
059ec3d9 133uschar *tls_dhparam = NULL;
3f7eeb86
PP
134#if defined(EXPERIMENTAL_OCSP) && !defined(USE_GNUTLS)
135uschar *tls_ocsp_file = NULL;
136#endif
059ec3d9
PH
137BOOL tls_offered = FALSE;
138uschar *tls_privatekey = NULL;
139BOOL tls_remember_esmtp = FALSE;
140uschar *tls_require_ciphers = NULL;
141uschar *tls_try_verify_hosts = NULL;
142uschar *tls_verify_certificates= NULL;
143uschar *tls_verify_hosts = NULL;
144#endif
145
146
147/* Input-reading functions for messages, so we can use special ones for
148incoming TCP/IP. The defaults use stdin. We never need these for any
149stand-alone tests. */
150
151#ifndef STAND_ALONE
152int (*receive_getc)(void) = stdin_getc;
153int (*receive_ungetc)(int) = stdin_ungetc;
154int (*receive_feof)(void) = stdin_feof;
155int (*receive_ferror)(void) = stdin_ferror;
58eb016e 156BOOL (*receive_smtp_buffered)(void) = NULL; /* Only used for SMTP */
059ec3d9
PH
157#endif
158
159
160/* List of per-address expansion variables for clearing and saving/restoring
161when verifying one address while routing/verifying another. We have to have
162the size explicit, because it is referenced from more than one module. */
163
164uschar **address_expansions[ADDRESS_EXPANSIONS_COUNT] = {
165 &deliver_address_data,
166 &deliver_domain,
167 &deliver_domain_data,
168 &deliver_domain_orig,
169 &deliver_domain_parent,
170 &deliver_localpart,
171 &deliver_localpart_data,
172 &deliver_localpart_orig,
173 &deliver_localpart_parent,
174 &deliver_localpart_prefix,
175 &deliver_localpart_suffix,
176 (uschar **)(&deliver_recipients),
177 &deliver_host,
178 &deliver_home,
179 &address_file,
180 &address_pipe,
181 &self_hostname,
182 NULL };
183
184int address_expansions_count = sizeof(address_expansions)/sizeof(uschar **);
185
186/* General global variables */
187
71fafd95 188header_line *acl_added_headers = NULL;
059ec3d9 189tree_node *acl_anchor = NULL;
8f128379 190
059ec3d9 191uschar *acl_not_smtp = NULL;
54cdb463
PH
192#ifdef WITH_CONTENT_SCAN
193uschar *acl_not_smtp_mime = NULL;
194#endif
45b91596 195uschar *acl_not_smtp_start = NULL;
8f128379 196
059ec3d9
PH
197uschar *acl_smtp_auth = NULL;
198uschar *acl_smtp_connect = NULL;
199uschar *acl_smtp_data = NULL;
80a47a2c
TK
200#ifndef DISABLE_DKIM
201uschar *acl_smtp_dkim = NULL;
202#endif
059ec3d9
PH
203uschar *acl_smtp_etrn = NULL;
204uschar *acl_smtp_expn = NULL;
205uschar *acl_smtp_helo = NULL;
206uschar *acl_smtp_mail = NULL;
207uschar *acl_smtp_mailauth = NULL;
8523533c
TK
208#ifdef WITH_CONTENT_SCAN
209uschar *acl_smtp_mime = NULL;
210#endif
8f128379 211uschar *acl_smtp_notquit = NULL;
059ec3d9
PH
212uschar *acl_smtp_predata = NULL;
213uschar *acl_smtp_quit = NULL;
214uschar *acl_smtp_rcpt = NULL;
215uschar *acl_smtp_starttls = NULL;
216uschar *acl_smtp_vrfy = NULL;
8f128379 217
059ec3d9 218BOOL acl_temp_details = FALSE;
38a0a95f
PH
219tree_node *acl_var_c = NULL;
220tree_node *acl_var_m = NULL;
059ec3d9 221uschar *acl_verify_message = NULL;
059ec3d9
PH
222string_item *acl_warn_logged = NULL;
223
224/* Names of SMTP places for use in ACL error messages, and corresponding SMTP
225error codes - keep in step with definitions of ACL_WHERE_xxxx in macros.h. */
226
227uschar *acl_wherenames[] = { US"RCPT",
228 US"MAIL",
229 US"PREDATA",
8523533c 230 US"MIME",
80a47a2c 231 US"DKIM",
059ec3d9
PH
232 US"DATA",
233 US"non-SMTP",
234 US"AUTH",
235 US"connection",
236 US"ETRN",
237 US"EXPN",
238 US"EHLO or HELO",
239 US"MAILAUTH",
45b91596 240 US"non-SMTP-start",
8f128379 241 US"NOTQUIT",
059ec3d9
PH
242 US"QUIT",
243 US"STARTTLS",
244 US"VRFY"
245 };
246
a5bd321b
PH
247uschar *acl_wherecodes[] = { US"550", /* RCPT */
248 US"550", /* MAIL */
249 US"550", /* PREDATA */
250 US"550", /* MIME */
80a47a2c 251 US"550", /* DKIM */
a5bd321b
PH
252 US"550", /* DATA */
253 US"0", /* not SMTP; not relevant */
254 US"503", /* AUTH */
255 US"550", /* connect */
256 US"458", /* ETRN */
257 US"550", /* EXPN */
258 US"550", /* HELO/EHLO */
259 US"0", /* MAILAUTH; not relevant */
260 US"0", /* not SMTP; not relevant */
8f128379 261 US"0", /* NOTQUIT; not relevant */
a5bd321b
PH
262 US"0", /* QUIT; not relevant */
263 US"550", /* STARTTLS */
264 US"252" /* VRFY */
059ec3d9 265 };
8e669ac1 266
69358f02
PH
267BOOL active_local_from_check = FALSE;
268BOOL active_local_sender_retain = FALSE;
9cbad13b 269BOOL accept_8bitmime = TRUE; /* deliberately not RFC compliant */
059ec3d9
PH
270address_item *addr_duplicate = NULL;
271
272address_item address_defaults = {
273 NULL, /* next */
274 NULL, /* parent */
275 NULL, /* first */
276 NULL, /* dupof */
277 NULL, /* start_router */
278 NULL, /* router */
279 NULL, /* transport */
280 NULL, /* host_list */
281 NULL, /* host_used */
282 NULL, /* fallback_hosts */
283 NULL, /* reply */
284 NULL, /* retries */
285 NULL, /* address */
286 NULL, /* unique */
287 NULL, /* cc_local_part */
288 NULL, /* lc_local_part */
289 NULL, /* local_part */
290 NULL, /* prefix */
291 NULL, /* suffix */
292 NULL, /* domain */
293 NULL, /* address_retry_key */
294 NULL, /* domain_retry_key */
295 NULL, /* current_dir */
296 NULL, /* home_dir */
297 NULL, /* message */
298 NULL, /* user_message */
299 NULL, /* onetime_parent */
300 NULL, /* pipe_expandn */
301 NULL, /* return_filename */
302 NULL, /* self_hostname */
303 NULL, /* shadow_message */
304 #ifdef SUPPORT_TLS
305 NULL, /* cipher */
306 NULL, /* peerdn */
307 #endif
308 (uid_t)(-1), /* uid */
309 (gid_t)(-1), /* gid */
310 0, /* flags */
311 { 0 }, /* domain_cache - any larger array should be zeroed */
312 { 0 }, /* localpart_cache - ditto */
313 -1, /* mode */
314 0, /* more_errno */
315 ERRNO_UNKNOWNERROR, /* basic_errno */
316 0, /* child_count */
317 -1, /* return_file */
318 SPECIAL_NONE, /* special_action */
319 DEFER, /* transport_return */
320 { /* fields that are propagated to children */
321 NULL, /* address_data */
322 NULL, /* domain_data */
323 NULL, /* localpart_data */
324 NULL, /* errors_address */
325 NULL, /* extra_headers */
326 NULL, /* remove_headers */
384152a6
TK
327#ifdef EXPERIMENTAL_SRS
328 NULL, /* srs_sender */
329#endif
059ec3d9
PH
330 }
331};
332
333uschar *address_file = NULL;
334uschar *address_pipe = NULL;
335BOOL address_test_mode = FALSE;
336tree_node *addresslist_anchor = NULL;
337int addresslist_count = 0;
338gid_t *admin_groups = NULL;
339BOOL admin_user = FALSE;
c46782ef 340BOOL allow_auth_unadvertised= FALSE;
059ec3d9
PH
341BOOL allow_domain_literals = FALSE;
342BOOL allow_mx_to_ip = FALSE;
343BOOL allow_unqualified_recipient = TRUE; /* For local messages */
344BOOL allow_unqualified_sender = TRUE; /* Reset for SMTP */
345BOOL allow_utf8_domains = FALSE;
346uschar *authenticated_id = NULL;
347uschar *authenticated_sender = NULL;
348BOOL authentication_failed = FALSE;
349auth_instance *auths = NULL;
350uschar *auth_advertise_hosts = US"*";
351auth_instance auth_defaults = {
352 NULL, /* chain pointer */
353 NULL, /* name */
354 NULL, /* info */
355 NULL, /* private options block pointer */
356 NULL, /* driver_name */
357 NULL, /* advertise_condition */
6c512171 358 NULL, /* client_condition */
059ec3d9
PH
359 NULL, /* public_name */
360 NULL, /* set_id */
361 NULL, /* server_mail_auth_condition */
362 NULL, /* server_debug_string */
16ff981e 363 NULL, /* server_condition */
059ec3d9
PH
364 FALSE, /* client */
365 FALSE, /* server */
366 FALSE /* advertised */
367};
368
369uschar *auth_defer_msg = US"reason not recorded";
370uschar *auth_defer_user_msg = US"";
f78eb7c6 371uschar *auth_vars[AUTH_VARS];
059ec3d9 372int auto_thaw = 0;
8523533c 373#ifdef WITH_CONTENT_SCAN
9e949f00 374BOOL av_failed = FALSE;
8523533c
TK
375uschar *av_scanner = US"sophie:/var/run/sophie"; /* AV scanner */
376#endif
059ec3d9
PH
377
378BOOL background_daemon = TRUE;
9a799bc0
PH
379
380#if BASE_62 == 62
059ec3d9
PH
381uschar *base62_chars=
382 US"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
9a799bc0
PH
383#else
384uschar *base62_chars= US"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
385#endif
386
059ec3d9
PH
387uschar *bi_command = NULL;
388uschar *big_buffer = NULL;
389int big_buffer_size = BIG_BUFFER_SIZE;
8523533c
TK
390#ifdef EXPERIMENTAL_BRIGHTMAIL
391uschar *bmi_alt_location = NULL;
392uschar *bmi_base64_tracker_verdict = NULL;
393uschar *bmi_base64_verdict = NULL;
394uschar *bmi_config_file = US"/opt/brightmail/etc/brightmail.cfg";
395int bmi_deliver = 1;
396int bmi_run = 0;
397uschar *bmi_verdicts = NULL;
398#endif
059ec3d9
PH
399int body_linecount = 0;
400int body_zerocount = 0;
401uschar *bounce_message_file = NULL;
402uschar *bounce_message_text = NULL;
403uschar *bounce_recipient = NULL;
404BOOL bounce_return_body = TRUE;
405BOOL bounce_return_message = TRUE;
406int bounce_return_size_limit = 100*1024;
407uschar *bounce_sender_authentication = NULL;
408int bsmtp_transaction_linecount = 0;
409
410int callout_cache_domain_positive_expire = 7*24*60*60;
411int callout_cache_domain_negative_expire = 3*60*60;
412int callout_cache_positive_expire = 24*60*60;
413int callout_cache_negative_expire = 2*60*60;
414uschar *callout_random_local_part = US"$primary_hostname-$tod_epoch-testing";
80a47a2c 415uschar *check_dns_names_pattern= US"(?i)^(?>(?(1)\\.|())[^\\W](?>[a-z0-9/_-]*[^\\W])?)+(\\.?)$";
059ec3d9
PH
416int check_log_inodes = 0;
417int check_log_space = 0;
a0d6ba8a 418BOOL check_rfc2047_length = TRUE;
059ec3d9
PH
419int check_spool_inodes = 0;
420int check_spool_space = 0;
421int clmacro_count = 0;
422uschar *clmacros[MAX_CLMACROS];
423BOOL config_changed = FALSE;
424FILE *config_file = NULL;
425uschar *config_filename = NULL;
426int config_lineno = 0;
35edf2ff
PH
427#ifdef CONFIGURE_GROUP
428gid_t config_gid = CONFIGURE_GROUP;
429#endif
059ec3d9
PH
430uschar *config_main_filelist = US CONFIGURE_FILE
431 "\0<-----------Space to patch configure_filename->";
432uschar *config_main_filename = NULL;
433
434#ifdef CONFIGURE_OWNER
435uid_t config_uid = CONFIGURE_OWNER;
436#endif
437
438int connection_max_messages= -1;
439uschar *continue_hostname = NULL;
440uschar *continue_host_address = NULL;
441BOOL continue_more = FALSE;
442int continue_sequence = 1;
443uschar *continue_transport = NULL;
444
e5a9dba6 445uschar *csa_status = NULL;
e4bdf652
JH
446BOOL cutthrough_delivery = FALSE;
447int cutthrough_fd = -1;
e5a9dba6 448
059ec3d9
PH
449BOOL daemon_listen = FALSE;
450uschar *daemon_smtp_port = US"smtp";
4aee0225
PH
451int daemon_startup_retries = 9;
452int daemon_startup_sleep = 30;
6a8f9482
TK
453
454#ifdef EXPERIMENTAL_DCC
455BOOL dcc_direct_add_header = FALSE;
456uschar *dcc_header = NULL;
457uschar *dcc_result = NULL;
458uschar *dccifd_address = US"/usr/local/dcc/var/dccifd";
459uschar *dccifd_options = US"header";
460#endif
461
3d235903 462BOOL debug_daemon = FALSE;
059ec3d9
PH
463int debug_fd = -1;
464FILE *debug_file = NULL;
465bit_table debug_options[] = {
466 { US"acl", D_acl },
467 { US"all", D_all },
468 { US"auth", D_auth },
469 { US"deliver", D_deliver },
470 { US"dns", D_dns },
471 { US"dnsbl", D_dnsbl },
472 { US"exec", D_exec },
473 { US"expand", D_expand },
474 { US"filter", D_filter },
475 { US"hints_lookup", D_hints_lookup },
476 { US"host_lookup", D_host_lookup },
477 { US"ident", D_ident },
478 { US"interface", D_interface },
479 { US"lists", D_lists },
480 { US"load", D_load },
481 { US"local_scan", D_local_scan },
482 { US"lookup", D_lookup },
483 { US"memory", D_memory },
484 { US"pid", D_pid },
485 { US"process_info", D_process_info },
486 { US"queue_run", D_queue_run },
487 { US"receive", D_receive },
488 { US"resolver", D_resolver },
489 { US"retry", D_retry },
490 { US"rewrite", D_rewrite },
491 { US"route", D_route },
492 { US"timestamp", D_timestamp },
493 { US"tls", D_tls },
494 { US"transport", D_transport },
495 { US"uid", D_uid },
496 { US"verify", D_verify }
497};
498int debug_options_count = sizeof(debug_options)/sizeof(bit_table);
499unsigned int debug_selector = 0;
500int delay_warning[DELAY_WARNING_SIZE] = { DELAY_WARNING_SIZE, 1, 24*60*60 };
5dff5817
PH
501uschar *delay_warning_condition=
502 US"${if or {"
e85a7ad5 503 "{ !eq{$h_list-id:$h_list-post:$h_list-subscribe:}{} }"
5dff5817
PH
504 "{ match{$h_precedence:}{(?i)bulk|list|junk} }"
505 "{ match{$h_auto-submitted:}{(?i)auto-generated|auto-replied} }"
506 "} {no}{yes}}";
059ec3d9
PH
507BOOL delivery_date_remove = TRUE;
508uschar *deliver_address_data = NULL;
509int deliver_datafile = -1;
510uschar *deliver_domain = NULL;
511uschar *deliver_domain_data = NULL;
512uschar *deliver_domain_orig = NULL;
513uschar *deliver_domain_parent = NULL;
514BOOL deliver_drop_privilege = FALSE;
515BOOL deliver_firsttime = FALSE;
516BOOL deliver_force = FALSE;
517BOOL deliver_freeze = FALSE;
518int deliver_frozen_at = 0;
519uschar *deliver_home = NULL;
520uschar *deliver_host = NULL;
521uschar *deliver_host_address = NULL;
522uschar *deliver_in_buffer = NULL;
523ino_t deliver_inode = 0;
524uschar *deliver_localpart = NULL;
525uschar *deliver_localpart_data = NULL;
526uschar *deliver_localpart_orig = NULL;
527uschar *deliver_localpart_parent = NULL;
528uschar *deliver_localpart_prefix = NULL;
529uschar *deliver_localpart_suffix = NULL;
530BOOL deliver_force_thaw = FALSE;
531BOOL deliver_manual_thaw = FALSE;
532uschar *deliver_out_buffer = NULL;
533int deliver_queue_load_max = -1;
534address_item *deliver_recipients = NULL;
535uschar *deliver_selectstring = NULL;
536BOOL deliver_selectstring_regex = FALSE;
537uschar *deliver_selectstring_sender = NULL;
538BOOL deliver_selectstring_sender_regex = FALSE;
8523533c
TK
539#ifdef WITH_OLD_DEMIME
540int demime_errorlevel = 0;
541int demime_ok = 0;
542uschar *demime_reason = NULL;
543#endif
4c590bd1 544BOOL disable_callout_flush = FALSE;
047bdd8c 545BOOL disable_delay_flush = FALSE;
54fc8428
PH
546#ifdef ENABLE_DISABLE_FSYNC
547BOOL disable_fsync = FALSE;
548#endif
7e66e54d 549BOOL disable_ipv6 = FALSE;
059ec3d9
PH
550BOOL disable_logging = FALSE;
551
80a47a2c 552#ifndef DISABLE_DKIM
2df588c9 553uschar *dkim_cur_signer = NULL;
9e5d6b55 554uschar *dkim_signers = NULL;
f7572e5a
TK
555uschar *dkim_signing_domain = NULL;
556uschar *dkim_signing_selector = NULL;
9e5d6b55 557uschar *dkim_verify_signers = US"$dkim_signers";
80a47a2c
TK
558BOOL dkim_collect_input = FALSE;
559BOOL dkim_disable_verify = FALSE;
f7572e5a
TK
560#endif
561
059ec3d9 562uschar *dns_again_means_nonexist = NULL;
e5a9dba6
PH
563int dns_csa_search_limit = 5;
564BOOL dns_csa_use_reverse = TRUE;
059ec3d9
PH
565uschar *dns_ipv4_lookup = NULL;
566int dns_retrans = 0;
567int dns_retry = 0;
1f4a55da 568int dns_use_dnssec = -1; /* <0 = not coerced */
e97d1f08 569int dns_use_edns0 = -1; /* <0 = not coerced */
059ec3d9 570uschar *dnslist_domain = NULL;
93655c46 571uschar *dnslist_matched = NULL;
059ec3d9
PH
572uschar *dnslist_text = NULL;
573uschar *dnslist_value = NULL;
574tree_node *domainlist_anchor = NULL;
575int domainlist_count = 0;
576BOOL dont_deliver = FALSE;
577BOOL dot_ends = TRUE;
578BOOL drop_cr = FALSE; /* No longer used */
0e22dfd1 579uschar *dsn_from = US DEFAULT_DSN_FROM;
059ec3d9
PH
580
581BOOL enable_dollar_recipients = FALSE;
582BOOL envelope_to_remove = TRUE;
583int errno_quota = ERRNO_QUOTA;
584uschar *errors_copy = NULL;
585int error_handling = ERRORS_SENDER;
586uschar *errors_reply_to = NULL;
587int errors_sender_rc = EXIT_FAILURE;
588
589gid_t exim_gid = EXIM_GID;
590BOOL exim_gid_set = TRUE; /* This gid is always set */
591uschar *exim_path = US BIN_DIRECTORY "/exim"
592 "\0<---------------Space to patch exim_path->";
593uid_t exim_uid = EXIM_UID;
594BOOL exim_uid_set = TRUE; /* This uid is always set */
595int expand_forbid = 0;
596int expand_nlength[EXPAND_MAXN+1];
597int expand_nmax = -1;
598uschar *expand_nstring[EXPAND_MAXN+1];
599BOOL expand_string_forcedfail = FALSE;
600uschar *expand_string_message;
601BOOL extract_addresses_remove_arguments = TRUE;
602uschar *extra_local_interfaces = NULL;
603
29aba418 604int fake_response = OK;
0e22dfd1
PH
605uschar *fake_response_text = US"Your message has been rejected but is "
606 "being kept for evaluation.\nIf it was a "
607 "legitimate message, it may still be "
608 "delivered to the target recipient(s).";
059ec3d9
PH
609int filter_n[FILTER_VARIABLE_COUNT];
610BOOL filter_running = FALSE;
611int filter_sn[FILTER_VARIABLE_COUNT];
f05da2e8
PH
612int filter_test = FTEST_NONE;
613uschar *filter_test_sfile = NULL;
614uschar *filter_test_ufile = NULL;
059ec3d9
PH
615uschar *filter_thisaddress = NULL;
616int finduser_retries = 0;
8523533c
TK
617#ifdef WITH_OLD_DEMIME
618uschar *found_extension = NULL;
619#endif
059ec3d9
PH
620uid_t fixed_never_users[] = { FIXED_NEVER_USERS };
621uschar *freeze_tell = NULL;
6a3f1455 622uschar *freeze_tell_config = NULL;
059ec3d9
PH
623uschar *fudged_queue_times = US"";
624
625uschar *gecos_name = NULL;
626uschar *gecos_pattern = NULL;
627rewrite_rule *global_rewrite_rules = NULL;
628
629uschar *headers_charset = US HEADERS_CHARSET;
630int header_insert_maxlen = 64 * 1024;
631header_line *header_last = NULL;
632header_line *header_list = NULL;
633int header_maxsize = HEADER_MAXSIZE;
634int header_line_maxsize = 0;
635
636header_name header_names[] = {
637 { US"bcc", 3, TRUE, htype_bcc },
638 { US"cc", 2, TRUE, htype_cc },
639 { US"date", 4, TRUE, htype_date },
640 { US"delivery-date", 13, FALSE, htype_delivery_date },
641 { US"envelope-to", 11, FALSE, htype_envelope_to },
642 { US"from", 4, TRUE, htype_from },
643 { US"message-id", 10, TRUE, htype_id },
644 { US"received", 8, FALSE, htype_received },
645 { US"reply-to", 8, FALSE, htype_reply_to },
646 { US"return-path", 11, FALSE, htype_return_path },
647 { US"sender", 6, TRUE, htype_sender },
648 { US"subject", 7, FALSE, htype_subject },
649 { US"to", 2, TRUE, htype_to }
650};
651
652int header_names_size = sizeof(header_names)/sizeof(header_name);
653
654BOOL header_rewritten = FALSE;
655uschar *helo_accept_junk_hosts = NULL;
656uschar *helo_allow_chars = US"";
657uschar *helo_lookup_domains = US"@ : @[]";
658uschar *helo_try_verify_hosts = NULL;
659BOOL helo_verified = FALSE;
d7b47fd0 660BOOL helo_verify_failed = FALSE;
059ec3d9 661uschar *helo_verify_hosts = NULL;
1ba28e2b 662const uschar *hex_digits = CUS"0123456789abcdef";
059ec3d9
PH
663uschar *hold_domains = NULL;
664BOOL host_checking = FALSE;
665BOOL host_checking_callout = FALSE;
666uschar *host_data = NULL;
667BOOL host_find_failed_syntax= FALSE;
668uschar *host_lookup = NULL;
b08b24c8 669BOOL host_lookup_deferred = FALSE;
059ec3d9
PH
670BOOL host_lookup_failed = FALSE;
671uschar *host_lookup_order = US"bydns:byaddr";
672uschar *host_lookup_msg = US"";
673int host_number = 0;
674uschar *host_number_string = NULL;
675uschar *host_reject_connection = NULL;
676tree_node *hostlist_anchor = NULL;
677int hostlist_count = 0;
678uschar *hosts_treat_as_local = NULL;
679uschar *hosts_connection_nolog = NULL;
680
681int ignore_bounce_errors_after = 10*7*24*60*60; /* 10 weeks */
682BOOL ignore_fromline_local = FALSE;
683uschar *ignore_fromline_hosts = NULL;
9ee44efb
PP
684BOOL inetd_wait_mode = FALSE;
685int inetd_wait_timeout = -1;
059ec3d9
PH
686uschar *interface_address = NULL;
687int interface_port = -1;
688BOOL is_inetd = FALSE;
0ce9abe6 689uschar *iterate_item = NULL;
059ec3d9
PH
690
691int journal_fd = -1;
692
693int keep_malformed = 4*24*60*60; /* 4 days */
694
695uschar *eldap_dn = NULL;
696int load_average = -2;
697BOOL local_error_message = FALSE;
698BOOL local_from_check = TRUE;
699uschar *local_from_prefix = NULL;
700uschar *local_from_suffix = NULL;
701
702#if HAVE_IPV6
703uschar *local_interfaces = US"<; ::0 ; 0.0.0.0";
704#else
705uschar *local_interfaces = US"0.0.0.0";
706#endif
707
708uschar *local_scan_data = NULL;
709int local_scan_timeout = 5*60;
710BOOL local_sender_retain = FALSE;
711gid_t local_user_gid = (gid_t)(-1);
712uid_t local_user_uid = (uid_t)(-1);
713
714tree_node *localpartlist_anchor= NULL;
715int localpartlist_count = 0;
716uschar *log_buffer = NULL;
717unsigned int log_extra_selector = LX_default;
718uschar *log_file_path = US LOG_FILE_PATH
719 "\0<--------------Space to patch log_file_path->";
720
721/* Those log options with L_xxx identifiers have values less than 0x800000 and
722are the ones that get put into log_write_selector. They can be used in calls to
723log_write() to test for the bit. The options with LX_xxx identifiers have
3f0945ff 724values greater than 0x80000000 and are put into log_extra_selector (without the
059ec3d9
PH
725top bit). They are never used in calls to log_write(), but are tested
726independently. This separation became necessary when the number of log
727selectors was getting close to filling a 32-bit word. */
728
f3f065bb
PH
729/* Note that this list must be in alphabetical order. */
730
059ec3d9 731bit_table log_options[] = {
49826d12 732 { US"acl_warn_skipped", LX_acl_warn_skipped },
059ec3d9
PH
733 { US"address_rewrite", L_address_rewrite },
734 { US"all", L_all },
735 { US"all_parents", L_all_parents },
736 { US"arguments", LX_arguments },
737 { US"connection_reject", L_connection_reject },
738 { US"delay_delivery", L_delay_delivery },
739 { US"deliver_time", LX_deliver_time },
740 { US"delivery_size", LX_delivery_size },
741 { US"dnslist_defer", L_dnslist_defer },
742 { US"etrn", L_etrn },
743 { US"host_lookup_failed", L_host_lookup_failed },
744 { US"ident_timeout", LX_ident_timeout },
745 { US"incoming_interface", LX_incoming_interface },
746 { US"incoming_port", LX_incoming_port },
747 { US"lost_incoming_connection", L_lost_incoming_connection },
748 { US"outgoing_port", LX_outgoing_port },
f3f065bb 749 { US"pid", LX_pid },
059ec3d9
PH
750 { US"queue_run", L_queue_run },
751 { US"queue_time", LX_queue_time },
2ac0e484 752 { US"queue_time_overall", LX_queue_time_overall },
059ec3d9
PH
753 { US"received_recipients", LX_received_recipients },
754 { US"received_sender", LX_received_sender },
755 { US"rejected_header", LX_rejected_header },
756 { US"rejected_headers", LX_rejected_header },
757 { US"retry_defer", L_retry_defer },
758 { US"return_path_on_delivery", LX_return_path_on_delivery },
759 { US"sender_on_delivery", LX_sender_on_delivery },
278c6e6c 760 { US"sender_verify_fail", LX_sender_verify_fail },
059ec3d9
PH
761 { US"size_reject", L_size_reject },
762 { US"skip_delivery", L_skip_delivery },
763 { US"smtp_confirmation", LX_smtp_confirmation },
764 { US"smtp_connection", L_smtp_connection },
765 { US"smtp_incomplete_transaction", L_smtp_incomplete_transaction },
b4ed4da0 766 { US"smtp_no_mail", LX_smtp_no_mail },
059ec3d9
PH
767 { US"smtp_protocol_error", L_smtp_protocol_error },
768 { US"smtp_syntax_error", L_smtp_syntax_error },
769 { US"subject", LX_subject },
770 { US"tls_certificate_verified", LX_tls_certificate_verified },
771 { US"tls_cipher", LX_tls_cipher },
1130bfb0 772 { US"tls_peerdn", LX_tls_peerdn },
3f0945ff 773 { US"tls_sni", LX_tls_sni },
1130bfb0 774 { US"unknown_in_list", LX_unknown_in_list }
059ec3d9
PH
775};
776
777int log_options_count = sizeof(log_options)/sizeof(bit_table);
6ea85e9a 778int log_reject_target = 0;
059ec3d9
PH
779uschar *log_selector_string = NULL;
780FILE *log_stderr = NULL;
781BOOL log_testing_mode = FALSE;
782BOOL log_timezone = FALSE;
6ea85e9a 783unsigned int log_write_selector= L_default;
059ec3d9
PH
784uschar *login_sender_address = NULL;
785int lookup_open_max = 25;
786uschar *lookup_value = NULL;
787
788macro_item *macros = NULL;
789uschar *mailstore_basename = NULL;
8523533c
TK
790#ifdef WITH_CONTENT_SCAN
791uschar *malware_name = NULL; /* Virus Name */
792#endif
d677b2f2 793int max_received_linelength= 0;
059ec3d9
PH
794int max_username_length = 0;
795int message_age = 0;
796uschar *message_body = NULL;
797uschar *message_body_end = NULL;
ddea74fa 798BOOL message_body_newlines = FALSE;
059ec3d9
PH
799int message_body_size = 0;
800int message_body_visible = 500;
801int message_ended = END_NOTSTARTED;
802uschar *message_headers = NULL;
803uschar *message_id;
804uschar *message_id_domain = NULL;
805uschar *message_id_text = NULL;
806struct timeval message_id_tv = { 0, 0 };
807uschar message_id_option[MESSAGE_ID_LENGTH + 3];
808uschar *message_id_external;
809int message_linecount = 0;
810BOOL message_logs = TRUE;
811int message_size = 0;
812uschar *message_size_limit = US"50M";
813uschar message_subdir[2] = { 0, 0 };
814uschar *message_reference = NULL;
8523533c
TK
815
816/* MIME ACL expandables */
817#ifdef WITH_CONTENT_SCAN
f7b63901 818int mime_anomaly_level = 0;
1ba28e2b 819const uschar *mime_anomaly_text = NULL;
8523533c
TK
820uschar *mime_boundary = NULL;
821uschar *mime_charset = NULL;
822uschar *mime_content_description = NULL;
823uschar *mime_content_disposition = NULL;
824uschar *mime_content_id = NULL;
825unsigned int mime_content_size = 0;
826uschar *mime_content_transfer_encoding = NULL;
827uschar *mime_content_type = NULL;
828uschar *mime_decoded_filename = NULL;
829uschar *mime_filename = NULL;
830int mime_is_multipart = 0;
831int mime_is_coverletter = 0;
832int mime_is_rfc822 = 0;
833int mime_part_count = -1;
834#endif
835
059ec3d9
PH
836BOOL mua_wrapper = FALSE;
837
838uid_t *never_users = NULL;
8523533c
TK
839#ifdef WITH_CONTENT_SCAN
840BOOL no_mbox_unspool = FALSE;
841#endif
059ec3d9
PH
842BOOL no_multiline_responses = FALSE;
843
844uid_t original_euid;
845gid_t originator_gid;
846uschar *originator_login = NULL;
847uschar *originator_name = NULL;
848uid_t originator_uid;
849uschar *override_local_interfaces = NULL;
850uschar *override_pid_file_path = NULL;
851
852BOOL parse_allow_group = FALSE;
853BOOL parse_found_group = FALSE;
854uschar *percent_hack_domains = NULL;
855uschar *pid_file_path = US PID_FILE_PATH
856 "\0<--------------Space to patch pid_file_path->";
cf8b11a5 857BOOL pipelining_enable = TRUE;
059ec3d9
PH
858uschar *pipelining_advertise_hosts = US"*";
859BOOL preserve_message_logs = FALSE;
860uschar *primary_hostname = NULL;
861BOOL print_topbitchars = FALSE;
862uschar process_info[PROCESS_INFO_SIZE];
921b12ca 863int process_info_len = 0;
059ec3d9
PH
864uschar *process_log_path = NULL;
865BOOL prod_requires_admin = TRUE;
fffda43a
TK
866uschar *prvscheck_address = NULL;
867uschar *prvscheck_keynum = NULL;
868uschar *prvscheck_result = NULL;
869
059ec3d9
PH
870
871uschar *qualify_domain_recipient = NULL;
872uschar *qualify_domain_sender = NULL;
873BOOL queue_2stage = FALSE;
874uschar *queue_domains = NULL;
875int queue_interval = -1;
876BOOL queue_list_requires_admin = TRUE;
877BOOL queue_only = FALSE;
878uschar *queue_only_file = NULL;
879int queue_only_load = -1;
8669f003 880BOOL queue_only_load_latch = TRUE;
059ec3d9
PH
881BOOL queue_only_override = TRUE;
882BOOL queue_only_policy = FALSE;
883BOOL queue_run_first_delivery = FALSE;
884BOOL queue_run_force = FALSE;
885BOOL queue_run_in_order = FALSE;
886BOOL queue_run_local = FALSE;
887int queue_run_max = 5;
888pid_t queue_run_pid = (pid_t)0;
889int queue_run_pipe = -1;
890BOOL queue_running = FALSE;
891BOOL queue_smtp = FALSE;
892uschar *queue_smtp_domains = NULL;
893
894unsigned int random_seed = 0;
fe0dab11 895tree_node *ratelimiters_cmd = NULL;
870f6ba8
TF
896tree_node *ratelimiters_conn = NULL;
897tree_node *ratelimiters_mail = NULL;
059ec3d9
PH
898uschar *raw_active_hostname = NULL;
899uschar *raw_sender = NULL;
900uschar **raw_recipients = NULL;
901int raw_recipients_count = 0;
902
903int rcpt_count = 0;
904int rcpt_fail_count = 0;
905int rcpt_defer_count = 0;
906gid_t real_gid;
907uid_t real_uid;
908BOOL really_exim = TRUE;
909BOOL receive_call_bombout = FALSE;
910int receive_linecount = 0;
911int receive_messagecount = 0;
912int receive_timeout = 0;
913int received_count = 0;
914uschar *received_for = NULL;
915
916/* This is the default text for Received headers generated by Exim. The
917date will be automatically added on the end. */
918
919uschar *received_header_text = US
920 "Received: "
921 "${if def:sender_rcvhost {from $sender_rcvhost\n\t}"
1e70f85b 922 "{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}"
059ec3d9
PH
923 "${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}"
924 "by $primary_hostname "
925 "${if def:received_protocol {with $received_protocol}} "
926 #ifdef SUPPORT_TLS
927 "${if def:tls_cipher {($tls_cipher)\n\t}}"
928 #endif
929 "(Exim $version_number)\n\t"
3e46c1aa 930 "${if def:sender_address {(envelope-from <$sender_address>)\n\t}}"
1ab52c69 931 "id $message_exim_id"
059ec3d9
PH
932 "${if def:received_for {\n\tfor $received_for}}"
933 "\0<---------------Space to patch received_header_text->";
934
935int received_headers_max = 30;
936uschar *received_protocol = NULL;
937int received_time = 0;
938uschar *recipient_data = NULL;
939uschar *recipient_unqualified_hosts = NULL;
2c7db3f5 940uschar *recipient_verify_failure = NULL;
059ec3d9
PH
941int recipients_count = 0;
942BOOL recipients_discarded = FALSE;
943recipient_item *recipients_list = NULL;
944int recipients_list_max = 0;
945int recipients_max = 0;
946BOOL recipients_max_reject = FALSE;
947const pcre *regex_AUTH = NULL;
948const pcre *regex_check_dns_names = NULL;
949const pcre *regex_From = NULL;
f1513293 950const pcre *regex_IGNOREQUOTA = NULL;
059ec3d9
PH
951const pcre *regex_PIPELINING = NULL;
952const pcre *regex_SIZE = NULL;
a5bd321b 953const pcre *regex_smtp_code = NULL;
059ec3d9 954const pcre *regex_ismsgid = NULL;
a7cbbf50
PP
955#ifdef WHITELIST_D_MACROS
956const pcre *regex_whitelisted_macro = NULL;
957#endif
8523533c
TK
958#ifdef WITH_CONTENT_SCAN
959uschar *regex_match_string = NULL;
960#endif
059ec3d9
PH
961int remote_delivery_count = 0;
962int remote_max_parallel = 2;
963uschar *remote_sort_domains = NULL;
964int retry_data_expire = 7*24*60*60;
965int retry_interval_max = 24*60*60;
966int retry_maximum_timeout = 0; /* set from retry config */
967retry_config *retries = NULL;
968uschar *return_path = NULL;
969BOOL return_path_remove = TRUE;
970int rewrite_existflags = 0;
971uschar *rfc1413_hosts = US"*";
8def5aaf 972int rfc1413_query_timeout = 5;
059ec3d9 973/* BOOL rfc821_domains = FALSE; <<< on the way out */
c1d94452 974uid_t root_gid = ROOT_GID;
059ec3d9
PH
975uid_t root_uid = ROOT_UID;
976
977router_instance *routers = NULL;
978router_instance router_defaults = {
979 NULL, /* chain pointer */
980 NULL, /* name */
981 NULL, /* info */
982 NULL, /* private options block pointer */
983 NULL, /* driver name */
984
985 NULL, /* address_data */
8523533c
TK
986#ifdef EXPERIMENTAL_BRIGHTMAIL
987 NULL, /* bmi_rule */
8e669ac1 988#endif
059ec3d9
PH
989 NULL, /* cannot_route_message */
990 NULL, /* condition */
991 NULL, /* current_directory */
992 NULL, /* debug_string */
993 NULL, /* domains */
994 NULL, /* errors_to */
995 NULL, /* expand_gid */
996 NULL, /* expand_uid */
997 NULL, /* expand_more */
998 NULL, /* expand_unseen */
999 NULL, /* extra_headers */
1000 NULL, /* fallback_hosts */
1001 NULL, /* home_directory */
1002 NULL, /* ignore_target_hosts */
1003 NULL, /* local_parts */
1004 NULL, /* pass_router_name */
1005 NULL, /* prefix */
1006 NULL, /* redirect_router_name */
1007 NULL, /* remove_headers */
1008 NULL, /* require_files */
1009 NULL, /* router_home_directory */
1010 US"freeze", /* self */
1011 NULL, /* senders */
1012 NULL, /* suffix */
1013 NULL, /* translate_ip_address */
1014 NULL, /* transport_name */
1015
1016 TRUE, /* address_test */
8523533c
TK
1017#ifdef EXPERIMENTAL_BRIGHTMAIL
1018 FALSE, /* bmi_deliver_alternate */
1019 FALSE, /* bmi_deliver_default */
1020 FALSE, /* bmi_dont_deliver */
1021#endif
059ec3d9
PH
1022 TRUE, /* expn */
1023 FALSE, /* caseful_local_part */
1024 FALSE, /* check_local_user */
1025 FALSE, /* disable_logging */
1026 FALSE, /* fail_verify_recipient */
1027 FALSE, /* fail_verify_sender */
1028 FALSE, /* gid_set */
1029 FALSE, /* initgroups */
1030 TRUE_UNSET, /* log_as_local */
1031 TRUE, /* more */
1032 FALSE, /* pass_on_timeout */
1033 FALSE, /* prefix_optional */
1034 TRUE, /* repeat_use */
1035 TRUE_UNSET, /* retry_use_local_part - fudge "unset" */
1036 FALSE, /* same_domain_copy_routing */
1037 FALSE, /* self_rewrite */
1038 FALSE, /* suffix_optional */
1039 FALSE, /* verify_only */
1040 TRUE, /* verify_recipient */
1041 TRUE, /* verify_sender */
1042 FALSE, /* uid_set */
1043 FALSE, /* unseen */
1044
1045 self_freeze, /* self_code */
1046 (uid_t)(-1), /* uid */
1047 (gid_t)(-1), /* gid */
1048
1049 NULL, /* fallback_hostlist */
1050 NULL, /* transport instance */
1051 NULL, /* pass_router */
1052 NULL /* redirect_router */
1053};
1054
1055ip_address_item *running_interfaces = NULL;
1056BOOL running_in_test_harness = FALSE;
1057
1058/* This is a weird one. The following string gets patched in the binary by the
1059script that sets up a copy of Exim for running in the test harness. It seems
1060that compilers are now clever, and share constant strings if they can.
1061Elsewhere in Exim the string "<" is used. The compiler optimization seems to
1062make use of the end of this string in order to save space. So the patching then
8669f003 1063wrecks this. We defeat this optimization by adding some additional characters
059ec3d9
PH
1064onto the end of the string. */
1065
1066uschar *running_status = US">>>running<<<" "\0EXTRA";
1067
1068int runrc = 0;
1069
1070uschar *search_error_message = NULL;
1071BOOL search_find_defer = FALSE;
1072uschar *self_hostname = NULL;
1073uschar *sender_address = NULL;
1074unsigned int sender_address_cache[(MAX_NAMED_LIST * 2)/32];
2a3eea10 1075uschar *sender_address_data = NULL;
059ec3d9
PH
1076BOOL sender_address_forced = FALSE;
1077uschar *sender_address_unrewritten = NULL;
1078uschar *sender_data = NULL;
1079unsigned int sender_domain_cache[(MAX_NAMED_LIST * 2)/32];
1080uschar *sender_fullhost = NULL;
1081uschar *sender_helo_name = NULL;
1082uschar **sender_host_aliases = &no_aliases;
1083uschar *sender_host_address = NULL;
1084uschar *sender_host_authenticated = NULL;
1085unsigned int sender_host_cache[(MAX_NAMED_LIST * 2)/32];
1f4a55da 1086BOOL sender_host_dnssec = FALSE;
059ec3d9
PH
1087uschar *sender_host_name = NULL;
1088int sender_host_port = 0;
1089BOOL sender_host_notsocket = FALSE;
1090BOOL sender_host_unknown = FALSE;
1091uschar *sender_ident = NULL;
1092BOOL sender_local = FALSE;
2fe1a124 1093BOOL sender_name_forced = FALSE;
870f6ba8
TF
1094uschar *sender_rate = NULL;
1095uschar *sender_rate_limit = NULL;
1096uschar *sender_rate_period = NULL;
059ec3d9
PH
1097uschar *sender_rcvhost = NULL;
1098BOOL sender_set_untrusted = FALSE;
1099uschar *sender_unqualified_hosts = NULL;
2c7db3f5 1100uschar *sender_verify_failure = NULL;
059ec3d9
PH
1101address_item *sender_verified_list = NULL;
1102address_item *sender_verified_failed = NULL;
1103int sender_verified_rc = -1;
1104BOOL sender_verified_responded = FALSE;
41c7c167
PH
1105uschar *sending_ip_address = NULL;
1106int sending_port = -1;
cd59ab18 1107SIGNAL_BOOL sigalrm_seen = FALSE;
059ec3d9
PH
1108uschar **sighup_argv = NULL;
1109int smtp_accept_count = 0;
1110BOOL smtp_accept_keepalive = TRUE;
1111int smtp_accept_max = 20;
1112int smtp_accept_max_nonmail= 10;
1113uschar *smtp_accept_max_nonmail_hosts = US"*";
1114int smtp_accept_max_per_connection = 1000;
1115uschar *smtp_accept_max_per_host = NULL;
1116int smtp_accept_queue = 0;
1117int smtp_accept_queue_per_connection = 10;
1118int smtp_accept_reserve = 0;
1119uschar *smtp_active_hostname = NULL;
1120BOOL smtp_authenticated = FALSE;
1f5b4c3d 1121uschar *smtp_banner = US"$smtp_active_hostname ESMTP "
059ec3d9
PH
1122 "Exim $version_number $tod_full"
1123 "\0<---------------Space to patch smtp_banner->";
1124BOOL smtp_batched_input = FALSE;
1125BOOL smtp_check_spool_space = TRUE;
b4ed4da0 1126int smtp_ch_index = 0;
3ee512ff
PH
1127uschar *smtp_cmd_argument = NULL;
1128uschar *smtp_cmd_buffer = NULL;
b4ed4da0
PH
1129time_t smtp_connection_start = 0;
1130uschar smtp_connection_had[SMTP_HBUFF_SIZE];
059ec3d9
PH
1131int smtp_connect_backlog = 20;
1132double smtp_delay_mail = 0.0;
1133double smtp_delay_rcpt = 0.0;
1134BOOL smtp_enforce_sync = TRUE;
1135FILE *smtp_in = NULL;
1136BOOL smtp_input = FALSE;
1137int smtp_load_reserve = -1;
1138int smtp_mailcmd_count = 0;
1139FILE *smtp_out = NULL;
1140uschar *smtp_etrn_command = NULL;
1141BOOL smtp_etrn_serialize = TRUE;
1142int smtp_max_synprot_errors= 3;
1143int smtp_max_unknown_commands = 3;
8f128379 1144uschar *smtp_notquit_reason = NULL;
059ec3d9
PH
1145uschar *smtp_ratelimit_hosts = NULL;
1146uschar *smtp_ratelimit_mail = NULL;
1147uschar *smtp_ratelimit_rcpt = NULL;
1148uschar *smtp_read_error = US"";
1149int smtp_receive_timeout = 5*60;
1150uschar *smtp_reserve_hosts = NULL;
1151BOOL smtp_return_error_details = FALSE;
1152int smtp_rlm_base = 0;
1153double smtp_rlm_factor = 0.0;
1154int smtp_rlm_limit = 0;
1155int smtp_rlm_threshold = INT_MAX;
1156int smtp_rlr_base = 0;
1157double smtp_rlr_factor = 0.0;
1158int smtp_rlr_limit = 0;
1159int smtp_rlr_threshold = INT_MAX;
1160BOOL smtp_use_pipelining = FALSE;
1161BOOL smtp_use_size = FALSE;
8523533c
TK
1162
1163#ifdef WITH_CONTENT_SCAN
1164uschar *spamd_address = US"127.0.0.1 783";
1165uschar *spam_bar = NULL;
1166uschar *spam_report = NULL;
1167uschar *spam_score = NULL;
1168uschar *spam_score_int = NULL;
1169#endif
1170#ifdef EXPERIMENTAL_SPF
65a7d8c3 1171uschar *spf_guess = US"v=spf1 a/24 mx/24 ptr ?all";
8523533c
TK
1172uschar *spf_header_comment = NULL;
1173uschar *spf_received = NULL;
1174uschar *spf_result = NULL;
1175uschar *spf_smtp_comment = NULL;
1176#endif
1177
059ec3d9
PH
1178BOOL split_spool_directory = FALSE;
1179uschar *spool_directory = US SPOOL_DIRECTORY
1180 "\0<--------------Space to patch spool_directory->";
8523533c
TK
1181#ifdef EXPERIMENTAL_SRS
1182uschar *srs_config = NULL;
1183uschar *srs_db_address = NULL;
1184uschar *srs_db_key = NULL;
384152a6
TK
1185int srs_hashlength = 6;
1186int srs_hashmin = -1;
1187int srs_maxage = 31;
8523533c
TK
1188uschar *srs_orig_recipient = NULL;
1189uschar *srs_orig_sender = NULL;
1190uschar *srs_recipient = NULL;
384152a6 1191uschar *srs_secrets = NULL;
8523533c 1192uschar *srs_status = NULL;
384152a6
TK
1193BOOL srs_usehash = TRUE;
1194BOOL srs_usetimestamp = TRUE;
8e669ac1 1195#endif
38a0a95f 1196BOOL strict_acl_vars = FALSE;
059ec3d9 1197int string_datestamp_offset= -1;
f1e5fef5
PP
1198int string_datestamp_length= 0;
1199int string_datestamp_type = -1;
059ec3d9
PH
1200BOOL strip_excess_angle_brackets = FALSE;
1201BOOL strip_trailing_dot = FALSE;
1202uschar *submission_domain = NULL;
1203BOOL submission_mode = FALSE;
2fe1a124 1204uschar *submission_name = NULL;
8800895a 1205BOOL suppress_local_fixups = FALSE;
f4ee74ac 1206BOOL suppress_local_fixups_default = FALSE;
059ec3d9
PH
1207BOOL synchronous_delivery = FALSE;
1208BOOL syslog_duplication = TRUE;
1209int syslog_facility = LOG_MAIL;
1210uschar *syslog_processname = US"exim";
1211BOOL syslog_timestamp = TRUE;
1212uschar *system_filter = NULL;
1213
1214uschar *system_filter_directory_transport = NULL;
1215uschar *system_filter_file_transport = NULL;
1216uschar *system_filter_pipe_transport = NULL;
1217uschar *system_filter_reply_transport = NULL;
1218
1219gid_t system_filter_gid = 0;
1220BOOL system_filter_gid_set = FALSE;
79d4bc3d 1221uid_t system_filter_uid = (uid_t)-1;
059ec3d9
PH
1222BOOL system_filter_uid_set = FALSE;
1223BOOL system_filtering = FALSE;
1224
1225BOOL tcp_nodelay = TRUE;
5dc43717
JJ
1226#ifdef USE_TCP_WRAPPERS
1227uschar *tcp_wrappers_daemon_name = US TCP_WRAPPERS_DAEMON_NAME;
1228#endif
8669f003 1229int test_harness_load_avg = 0;
059ec3d9
PH
1230int thismessage_size_limit = 0;
1231int timeout_frozen_after = 0;
1232BOOL timestamps_utc = FALSE;
1233
1234transport_instance *transports = NULL;
1235
1236transport_instance transport_defaults = {
1237 NULL, /* chain pointer */
1238 NULL, /* name */
1239 NULL, /* info */
1240 NULL, /* private options block pointer */
1241 NULL, /* driver name */
1242 NULL, /* setup entry point */
1243 1, /* batch_max */
1244 NULL, /* batch_id */
1245 NULL, /* home_dir */
1246 NULL, /* current_dir */
1247 TRUE, /* multi-domain */
1248 FALSE, /* overrides_hosts */
1249 100, /* max_addresses */
1250 500, /* connection_max_messages */
1251 FALSE, /* deliver_as_creator */
1252 FALSE, /* disable_logging */
1253 FALSE, /* initgroups */
1254 FALSE, /* uid_set */
1255 FALSE, /* gid_set */
1256 (uid_t)(-1), /* uid */
1257 (gid_t)(-1), /* gid */
1258 NULL, /* expand_uid */
1259 NULL, /* expand_gid */
1260 NULL, /* warn_message */
1261 NULL, /* shadow */
1262 NULL, /* shadow_condition */
1263 NULL, /* filter_command */
1264 NULL, /* add_headers */
1265 NULL, /* remove_headers */
1266 NULL, /* return_path */
1267 NULL, /* debug_string */
1268 NULL, /* message_size_limit */
1269 NULL, /* headers_rewrite */
1270 NULL, /* rewrite_rules */
1271 0, /* rewrite_existflags */
1272 300, /* filter_timeout */
1273 FALSE, /* body_only */
1274 FALSE, /* delivery_date_add */
1275 FALSE, /* envelope_to_add */
1276 FALSE, /* headers_only */
1277 FALSE, /* rcpt_include_affixes */
1278 FALSE, /* return_path_add */
1279 FALSE, /* return_output */
1280 FALSE, /* return_fail_output */
1281 FALSE, /* log_output */
1282 FALSE, /* log_fail_output */
1283 FALSE, /* log_defer_output */
1284 TRUE_UNSET /* retry_use_local_part: BOOL, but set neither
1285 1 nor 0 so can detect unset */
1286};
1287
1288int transport_count;
332f5cf3 1289int transport_newlines;
059ec3d9
PH
1290uschar **transport_filter_argv = NULL;
1291int transport_filter_timeout;
2e2a30b4 1292BOOL transport_filter_timed_out = FALSE;
059ec3d9
PH
1293int transport_write_timeout= 0;
1294
1295tree_node *tree_dns_fails = NULL;
1296tree_node *tree_duplicates = NULL;
1297tree_node *tree_nonrecipients = NULL;
1298tree_node *tree_unusable = NULL;
1299
1300BOOL trusted_caller = FALSE;
e2f5dc15 1301BOOL trusted_config = TRUE;
059ec3d9
PH
1302gid_t *trusted_groups = NULL;
1303uid_t *trusted_users = NULL;
1304uschar *timezone_string = US TIMEZONE_DEFAULT;
1305
1306uschar *unknown_login = NULL;
1307uschar *unknown_username = NULL;
1308uschar *untrusted_set_sender = NULL;
1309
1310/* A regex for matching a "From_" line in an incoming message, in the form
1311
1312 From ph10 Fri Jan 5 12:35 GMT 1996
1313
1314which the "mail" commands send to the MTA (undocumented, of course), or in
1315the form
1316
1317 From ph10 Fri, 7 Jan 97 14:00:00 GMT
1318
1319which is apparently used by some UUCPs, despite it not being in RFC 976.
1320Because of variations in time formats, just match up to the minutes. That
1321should be sufficient. Examples have been seen of time fields like 12:1:03,
1322so just require one digit for hours and minutes. The weekday is also absent
1323in some forms. */
1324
1325uschar *uucp_from_pattern = US
1326 "^From\\s+(\\S+)\\s+(?:[a-zA-Z]{3},?\\s+)?" /* Common start */
1327 "(?:" /* Non-extracting bracket */
1328 "[a-zA-Z]{3}\\s+\\d?\\d|" /* First form */
1329 "\\d?\\d\\s+[a-zA-Z]{3}\\s+\\d\\d(?:\\d\\d)?" /* Second form */
1330 ")" /* End alternation */
1331 "\\s+\\d\\d?:\\d\\d?"; /* Start of time */
1332
1333uschar *uucp_from_sender = US"$1";
1334
1335uschar *warn_message_file = NULL;
1336uschar *warnmsg_delay = NULL;
1337uschar *warnmsg_recipients = NULL;
1338BOOL write_rejectlog = TRUE;
1339
f45100a3
PP
1340uschar *version_copyright =
1341 US"Copyright (c) University of Cambridge, 1995 - 2012\n"
ab6dcfbe 1342 "(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2012";
059ec3d9
PH
1343uschar *version_date = US"?";
1344uschar *version_cnumber = US"????";
1345uschar *version_string = US"?";
1346
1347int warning_count = 0;
1348
1349/* End of globals.c */