/*************************************************
*     Exim - an Internet mail transport agent    *
*************************************************/

/* Copyright (c) University of Cambridge 1995 - 1999 */
/* See the file NOTICE for conditions of use and distribution. */

/* All the global variables are defined together in this one module, so that
they are easy to find. */

#include "exim.h"


/* The OSF1 linker puts out a worrying warning if any sections contain no
executable code. It says

Warning: Linking some objects which contain exception information sections
        and some which do not. This may cause fatal runtime exception handling
        problems.

As this may cause people to worry needlessly, include a dummy function here
to stop the message from appearing. Make it reference itself to stop picky
compilers complaining that it is unused, and put in a dummy argument to stop
even pickier compilers complaining about infinite loops. */

static void dummy(int x) { dummy(x-1); }


/* For comments on these variables, see globals.h. I'm too idle to
duplicate them here... */

#ifdef SUPPORT_DSN
BOOL   dsn                    = FALSE;
char  *dsn_envid              = NULL;
int    dsn_ret                = 0;
pcre  *regex_DSN              = NULL;
BOOL   smtp_use_dsn           = FALSE;
#endif

#ifdef EXIM_PERL
char  *opt_perl_startup       = NULL;
BOOL   opt_perl_at_start      = FALSE;
BOOL   opt_perl_started       = FALSE;
#endif

BOOL   accept_8bitmime        = FALSE;
BOOL   accept_call_bombout    = FALSE;
int    accept_timeout         = 0;
address_item *addr_duplicate  = NULL;
char  *address_directory_transport = "address_directory";
char  *address_directory2_transport = "address_directory2";
char  *address_file           = NULL;
char  *address_file_transport = "address_file";
char  *address_pipe           = NULL;
char  *address_pipe_transport = "address_pipe";
char  *address_reply_transport = "address_reply";
BOOL   address_test_mode      = FALSE;
BOOL   admin_user             = FALSE;
BOOL   allow_unqualified_recipient = TRUE;    /* For local messages */
BOOL   allow_unqualified_sender = TRUE;       /* Reset for SMTP */
BOOL   always_bcc             = FALSE;
int    auto_thaw              = 0;

int    batch_max              = -1;
char  *bi_command             = NULL;
char  *big_buffer             = NULL;
int    big_buffer_size        = BIG_BUFFER_SIZE;
int    body_linecount         = 0;

BOOL   check_dns_names        = TRUE;
char  *check_dns_names_pattern= "(?i)^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$";
BOOL   check_relay            = FALSE;
int    check_log_inodes       = 0;
int    check_log_space        = 0;
int    check_spool_inodes     = 0;
int    check_spool_space      = 0;
int    clmacro_count          = 0;
char  *clmacros[MAX_CLMACROS];
BOOL   collapse_source_routes = FALSE;
BOOL   config_changed         = FALSE;
FILE  *config_file            = NULL;
char  *config_filename        = CONFIGURE_FILE
			"\0<-----------Space to patch configure_filename->";
int    config_lineno          = 0;
char  *continue_hostname      = NULL;
BOOL   continue_more          = FALSE;
int    continue_sequence      = 1;
char  *continue_transport     = NULL;

BOOL   daemon_listen          = FALSE;
off_t  data_start_offset      = MESSAGE_ID_LENGTH + 3;
FILE  *debug_file             = NULL;
int    debug_level            = -1;
pid_t  debug_pid              = 0;
BOOL   debug_trace_memory     = FALSE;
int    delay_warning[DELAY_WARNING_SIZE] = { DELAY_WARNING_SIZE, 1, 24*60*60 };
char  *delay_warning_condition= NULL;
BOOL   delivery_date_remove   = TRUE;
char  *deliver_in_buffer      = NULL;
char  *deliver_out_buffer     = NULL;
int    deliver_datafile       = -1;
char  *deliver_domain         = NULL;
char  *deliver_domain_orig    = NULL;
char  *deliver_domain_parent  = NULL;
BOOL   deliver_firsttime      = FALSE;
BOOL   deliver_force          = FALSE;
BOOL   deliver_freeze         = FALSE;
int    deliver_frozen_at      = 0;
char  *deliver_home           = NULL;
char  *deliver_host           = NULL;
char  *deliver_host_address   = NULL;
int    deliver_load_max       = -1;
char  *deliver_localpart      = NULL;
char  *deliver_localpart_orig = NULL;
char  *deliver_localpart_parent = NULL;
char  *deliver_localpart_prefix = NULL;
char  *deliver_localpart_suffix = NULL;
BOOL   deliver_manual_thaw    = FALSE;
int    deliver_queue_load_max = -1;
address_item *deliver_recipients = NULL;
char  *deliver_selectstring   = NULL;
director_instance *directors  = NULL;

director_instance director_defaults = {
   NULL,                      /* chain pointer */
   NULL,                      /* name */
   NULL,                      /* info */
   NULL,                      /* private options block pointer */
   NULL,                      /* driver name */
   NULL,                      /* domains */
   NULL,                      /* except_domains */
   NULL,                      /* local_parts */
   NULL,                      /* except_local_parts */
   NULL,                      /* errors_to */
   NULL,                      /* extra_headers */
   NULL,                      /* remove_headers */
   NULL,                      /* debug_string */
   NULL,                      /* fallback_hosts */
   NULL,                      /* fallback_hostlist */
   NULL,                      /* re_domains */
   NULL,                      /* re_except_domains */
   NULL,                      /* re_local_parts */
   NULL,                      /* re_except_local_parts */
   TRUE,                      /* more */
   FALSE,                     /* verify_only */
   TRUE,                      /* verify_sender */
   TRUE,                      /* verify_recipient */
   NULL,                      /* expand_uid */
   NULL,                      /* expand_gid */
   (uid_t)(-1),               /* uid */
   (gid_t)(-1),               /* gid */
   FALSE,                     /* uid_set */
   FALSE,                     /* gid_set */
   FALSE,                     /* initgroups */
   NULL,                      /* transport */
   NULL,                      /* expanded_transport */
   NULL,                      /* condition */
   NULL,                      /* prefix */
   NULL,                      /* suffix */
   NULL,                      /* senders */
   NULL,                      /* except_senders */
   NULL,                      /* require_files */
   NULL,                      /* new_director */
   NULL,                      /* re_senders */
   NULL,                      /* re_except_senders */
   NULL,                      /* new (director) */
   FALSE,                     /* unseen */
   FALSE,                     /* prefix_optional */
   FALSE,                     /* suffix_optional */
   FALSE,                     /* fail_verify_sender */
   FALSE,                     /* fail_verify_recipient */
   TRUE                       /* expn */
};

char  *dns_again_means_nonexist = NULL;
int    dns_retrans            = 0;
int    dns_retry              = 0;
char  *domain_data            = NULL;
BOOL   dont_deliver           = FALSE;
BOOL   dot_ends               = TRUE;
BOOL   drop_cr                = FALSE;

BOOL   enable_dollar_recipients = FALSE;
BOOL   envelope_to_remove     = TRUE;
char  *errmsg_file            = NULL;
char  *errmsg_text            = NULL;
char  *errmsg_recipient       = NULL;
int    errno_quota            = ERRNO_QUOTA;
char  *errors_copy            = NULL;
int    error_handling         = ERRORS_SENDER;
char  *errors_address         = "postmaster";
char  *errors_reply_to        = NULL;
int    errors_sender_rc       = EXIT_FAILURE;

#ifdef EXIM_GID
gid_t  exim_gid               = EXIM_GID;
BOOL   exim_gid_set           = TRUE;
#else
gid_t  exim_gid               = 0;
BOOL   exim_gid_set           = FALSE;
#endif

char  *exim_path              = BIN_DIRECTORY "/exim"
			"\0<---------------Space to patch exim_path->";

#ifdef EXIM_UID
uid_t  exim_uid               = EXIM_UID;
BOOL   exim_uid_set           = TRUE;
#else
uid_t  exim_uid               = 0;
BOOL   exim_uid_set           = FALSE;
#endif

int    expand_nlength[EXPAND_MAXN+1];
int    expand_nmax            = -1;
char  *expand_nstring[EXPAND_MAXN+1];
BOOL   expand_string_forcedfail = FALSE;
char  *expand_string_message;
BOOL   extract_addresses_remove_arguments = TRUE;

char  *filter_fmsg            = NULL;
int    filter_n[FILTER_VARIABLE_COUNT];
BOOL   filter_running         = FALSE;
int    filter_sn[FILTER_VARIABLE_COUNT];
char  *filter_test            = NULL;
char  *filter_thisaddress     = NULL;
int    finduser_retries       = 0;
BOOL   forbid_domain_literals = FALSE;
BOOL   freeze_tell_mailmaster = FALSE;

char  *gecos_name             = NULL;
char  *gecos_pattern          = NULL;

BOOL   have_seteuid           = HAVE_SETEUID || HAVE_SETRESUID;
BOOL   header_changed         = FALSE;
header_line *header_last      = NULL;
header_line *header_list      = NULL;
header_name *header_names     = NULL;

header_name header_names_normal[] = {
  { "Bcc",         3 },       /* This data must be in the correct */
  { "Cc",          2 },       /* order as defined by the enum for */
  { "Date",        4 },       /* the hn_xxx offsets. */
  { "From",        4 },
  { "Message-Id", 10 },
  { "Sender",      6 },
  { "To",          2 },
  { "Reply-To",    8 },
  { "Subject",     7 }
};

header_name header_names_resent[] = {
  { "Resent-Bcc",        10 }, /* This data must be in the correct */
  { "Resent-Cc",          9 }, /* order as defined by the enum for */
  { "Resent-Date",       11 }, /* the hn_xxx offsets. */
  { "Resent-From",       11 },
  { "Resent-Message-Id", 17 },
  { "Resent-Sender",     13 },
  { "Resent-To",          9 },
  { "Resent-Reply-To",   15 },
  { "Resent-Subject",    14 }
};

BOOL   headers_check_syntax   = FALSE;
BOOL   headers_checks_fail    = TRUE;
BOOL   headers_sender_verify  = FALSE;
BOOL   headers_sender_verify_errmsg = FALSE;
char  *helo_accept_junk_hosts = NULL;
host_item *helo_accept_junk_hostlist = NULL;
char  *helo_accept_junk_nets  = NULL;
ip_net_item *helo_accept_junk_netlist = NULL;
BOOL   helo_strict_syntax     = FALSE;
BOOL   helo_verify            = FALSE;
char  *helo_verify_except_hosts = NULL;
host_item *helo_verify_except_hostlist = NULL;
char  *helo_verify_except_nets = NULL;
ip_net_item *helo_verify_except_netlist = NULL;
char  *hold_domains           = NULL;
char  *hold_domains_except    = NULL;
BOOL   host_checking          = FALSE;
BOOL   host_find_failed_syntax= FALSE;
char  *host_findbyaddr_msg    = "";
char  *host_lookup_nets       = NULL;
ip_net_item *host_lookup_netlist = NULL;
int    host_number            = 0;
char  *host_number_string     = NULL;
char  *hosts_treat_as_local   = NULL;

BOOL   ignore_errmsg_errors   = FALSE;
int    ignore_errmsg_errors_after = 0;
BOOL   ignore_fromline_local  = FALSE;
char  *ignore_fromline_nets   = NULL;
ip_net_item *ignore_fromline_netlist = NULL;
int    journal_fd             = -1;

int    keep_malformed         = 4*24*60*60;    /* 4 days */
BOOL   kill_ip_options        = TRUE;

int    load_average           = -2;
char  *local_domains          = NULL;
BOOL   local_domains_include_host = FALSE;
BOOL   local_domains_include_host_literals = FALSE;
BOOL   local_error_message    = FALSE;
char  *local_interfaces       = NULL;
ip_address_item *local_interface_data = NULL;
char  *local_part_data        = NULL;
BOOL   locally_caseless       = TRUE;
BOOL   log_all_parents        = FALSE;
BOOL   log_arguments          = FALSE;
char  *log_buffer             = NULL;
char  *log_file_path          = LOG_FILE_PATH
			  "\0<--------------Space to patch log_file_path->";
BOOL   log_ip_options         = TRUE;
int    log_level              = 5;
BOOL   log_received_sender    = FALSE;
BOOL   log_received_recipients = FALSE;
BOOL   log_refused_recipients = FALSE;
BOOL   log_rewrites           = FALSE;
BOOL   log_smtp_confirmation  = FALSE;
BOOL   log_smtp_connections   = FALSE;
BOOL   log_smtp_syntax_errors = FALSE;
FILE  *log_stderr             = NULL;
BOOL   log_subject            = FALSE;
char  *lookup_key             = NULL;
int    lookup_open_max        = 25;

macro_item *macros            = NULL;
char  **mailer_argv;
int    max_username_length    = 0;
char  *message_body           = NULL;
int    message_body_visible   = 500;
char  *message_filter         = NULL;

char  *message_filter_directory_transport = NULL;
char  *message_filter_directory2_transport = NULL;
char  *message_filter_file_transport = NULL;
char  *message_filter_pipe_transport = NULL;
char  *message_filter_reply_transport = NULL;

gid_t  message_filter_gid     = 0;
BOOL   message_filter_gid_set = FALSE;
uid_t  message_filter_uid     = 0;
BOOL   message_filter_uid_set = FALSE;
char  *message_id;
char  *message_id_text        = NULL;
char   message_id_option[MESSAGE_ID_LENGTH + 3];
char  *message_id_external;
int    message_linecount      = 0;
FILE  *message_log            = NULL;
char  *message_precedence     = NULL;
int    message_size           = 0;
int    message_size_limit     = 0;
BOOL   message_size_limit_count_recipients = FALSE;
char   message_subdir[2]      = "\0";
char  *message_reference      = NULL;

uid_t *never_users            = NULL;
gid_t  nobody_gid             = 0;
BOOL   nobody_gid_set         = FALSE;
uid_t  nobody_uid             = 0;
BOOL   nobody_uid_set         = FALSE;

uid_t  original_euid;
gid_t  originator_gid;
char  *originator_login;
uid_t  originator_uid;

BOOL   parse_allow_group      = FALSE;
BOOL   parse_found_group      = FALSE;
BOOL   passed_channel         = FALSE;
char  *percent_hack_domains   = NULL;
char  *pid_file_path          = PID_FILE_PATH
			  "\0<--------------Space to patch pid_file_path->";
BOOL   preserve_message_logs  = FALSE;
char  *primary_hostname       = NULL;
char  *primary_hostname_lc    = NULL;
BOOL   print_topbitchars      = FALSE;
char   process_info[PROCESS_INFO_SIZE];
BOOL   prod_requires_admin    = TRUE;
char  *prohibition_message    = NULL;
char  *prohibition_reason     = NULL;

char  *qualify_domain_recipient = NULL;
char  *qualify_domain_sender  = NULL;
BOOL   queue_2stage           = FALSE;
BOOL   queue_list_requires_admin = TRUE;
BOOL   queue_run_force        = FALSE;
BOOL   queue_run_in_order     = FALSE;
BOOL   queue_run_local        = FALSE;
BOOL   queue_running          = FALSE;
pid_t  queue_run_pid          = (pid_t)0;
int    queue_interval         = -1;
BOOL   queue_only             = FALSE;
char  *queue_only_file        = NULL;
int    queue_only_load        = -1;
BOOL   queue_remote           = FALSE;
char  *queue_remote_except    = NULL;
int    queue_run_max          = 5;
BOOL   queue_smtp             = FALSE;
char  *queue_smtp_except      = NULL;

char  *rbl_domains            = NULL;
char  *rbl_except_nets        = NULL;
ip_net_item *rbl_except_netlist = NULL;
header_line *rbl_header       = NULL;
BOOL   rbl_host               = FALSE;
BOOL   rbl_log_rcpt_count     = FALSE;
BOOL   rbl_log_headers        = FALSE;
BOOL   rbl_reject_recipients  = TRUE;
BOOL   rbl_warn_header        = TRUE;
char  *raw_sender             = NULL;
char **raw_recipients         = NULL;

re_block *re_dns_again_means_nonexist = NULL;
re_block *re_hold_domains     = NULL;
re_block *re_hold_domains_except = NULL;
re_block *re_hosts_treat_as_local = NULL;
re_block *re_local_domains    = NULL;
re_block *re_percent_hack_domains = NULL;
re_block *re_queue_remote_except = NULL;
re_block *re_queue_smtp_except = NULL;
re_block *re_receiver_verify_addresses = NULL;
re_block *re_receiver_verify_senders = NULL;
re_block *re_receiver_verify_senders_except = NULL;
re_block *re_recipients_reject_except = NULL;
re_block *re_relay_domains    = NULL;
re_block *re_remote_sort      = NULL;
re_block *re_sender_accept    = NULL;
re_block *re_sender_accept_recipients = NULL;
re_block *re_sender_address_relay = NULL;
re_block *re_sender_reject    = NULL;
re_block *re_sender_reject_except = NULL;
re_block *re_sender_reject_recipients = NULL;

gid_t  real_gid;
uid_t  real_uid;
char  *real_sender_address;
BOOL   really_exim            = TRUE;
int    received_count         = 0;
char  *received_for           = NULL;

/* This is the default text for Received headers generated by Exim. The
date will be automatically added on the end. */

char  *received_header_text   =
    "Received: "
    "${if def:sender_rcvhost {from ${sender_rcvhost}\n\t}"
    "{${if def:sender_ident {from ${sender_ident} }}"
    "${if def:sender_helo_name {(helo=${sender_helo_name})\n\t}}}}"
    "by ${primary_hostname} "
    "${if def:received_protocol {with ${received_protocol}}} "
    "(Exim ${version_number} #${compile_number})\n\t"
    "id ${message_id}"
    "${if def:received_for {\n\tfor $received_for}}"
    "\0<---------------Space to patch received_header_text->";

int    received_headers_max   = 30;
char  *received_protocol      = NULL;
int    received_time          = 0;
BOOL   receiver_try_verify    = FALSE;
char  *receiver_unqualified_hosts = NULL;
host_item *receiver_unqualified_hostlist = NULL;
char  *receiver_unqualified_nets = NULL;
ip_net_item *receiver_unqualified_netlist = NULL;
BOOL   receiver_verify        = FALSE;
char  *receiver_verify_addresses = NULL;
char  *receiver_verify_except_hosts = NULL;
host_item *receiver_verify_except_hostlist = NULL;
char  *receiver_verify_except_nets = NULL;
ip_net_item *receiver_verify_except_netlist = NULL;
char  *receiver_verify_senders = NULL;
char  *receiver_verify_senders_except = NULL;
int    recipients_count       = 0;
recipient_item *recipients_list = NULL;
int    recipients_list_max    = 0;
int    recipients_max         = 0;
BOOL   recipients_max_reject  = FALSE;
char  *recipients_reject_except = NULL;
BOOL   refuse_all_rcpts       = FALSE;
BOOL   refuse_ip_options      = TRUE;
char **regcomp_error_pointer  = NULL;
pcre  *regex_check_dns_names  = NULL;
pcre  *regex_From             = NULL;
pcre  *regex_SIZE             = NULL;
pcre  *regex_ismsgid          = NULL;
char   *relay_domains         = NULL;
BOOL   relay_domains_include_local_mx = FALSE;
BOOL   relay_need_either      = FALSE;
int    remote_max_parallel    = 1;
char  *remote_sort            = NULL;
int    retry_interval_max     = 24*60*60;
int    retry_maximum_timeout  = 0;        /* set from retry config */
retry_config *retries         = NULL;
char  *return_path            = NULL;
BOOL   return_path_remove     = TRUE;
int    return_size_limit      = 100*1024;
int    rewrite_existflags     = 0;
rewrite_rule *rewrite_rules   = NULL;
char  *rfc1413_except_hosts   = NULL;
host_item *rfc1413_except_hostlist = NULL;
char  *rfc1413_except_nets    = NULL;
ip_net_item *rfc1413_except_netlist = NULL;
int    rfc1413_query_timeout  = 30;
BOOL   rfc821_domains         = FALSE;
uid_t  root_uid               = ROOT_UID;
char  *route_option           = NULL;

router_instance *routers  = NULL;
router_instance router_defaults = {
   NULL,                      /* chain pointer */
   NULL,                      /* name */
   NULL,                      /* info */
   NULL,                      /* private options block pointer */
   NULL,                      /* driver name */
   NULL,                      /* domains */
   NULL,                      /* except_domains */
   NULL,                      /* local_parts */
   NULL,                      /* except_local_parts */
   NULL,                      /* errors_to */
   NULL,                      /* extra_headers */
   NULL,                      /* remove_headers */
   NULL,                      /* debug_string */
   NULL,                      /* fallback_hosts */
   NULL,                      /* fallback_hostlist */
   NULL,                      /* re_domains */
   NULL,                      /* re_except_domains */
   NULL,                      /* re_local_parts */
   NULL,                      /* re_except_local_parts */
   TRUE,                      /* more */
   FALSE,                     /* verify_only */
   TRUE,                      /* verify_sender */
   TRUE,                      /* verify_recipient */
   NULL,                      /* expand_uid */
   NULL,                      /* expand_gid */
   (uid_t)(-1),               /* uid */
   (gid_t)(-1),               /* gid */
   FALSE,                     /* uid_set */
   FALSE,                     /* gid_set */
   FALSE,                     /* initgroups */
   NULL,                      /* transport instance */
   NULL,                      /* expanded_transport */
   NULL,                      /* condition */
   NULL,                      /* senders */
   NULL,                      /* except_senders */
   NULL,                      /* require_files */
   NULL,                      /* re_senders */
   NULL,                      /* re_except_senders */
   FALSE,                     /* unseen */
   FALSE,                     /* fail_verify_sender */
   FALSE,                     /* fail_verify_recipient */
   FALSE,                     /* pass_on_timeout */
   "freeze",                  /* self */
   self_freeze,               /* self_code */
   FALSE                      /* self_rewrite */
};

BOOL   search_find_defer      = FALSE;
int    security_level         = 0;
char  *security_type          = NULL;
char  *self_hostname          = NULL;
char  *sender_accept          = NULL;
char  *sender_accept_recipients = NULL;
char  *sender_address         = NULL;
BOOL   sender_address_forced  = FALSE;
char  *sender_address_relay   = NULL;
BOOL   sender_address_rewritten = FALSE;
char  *sender_fullhost        = NULL;
char  *sender_helo_name       = NULL;
char  *sender_host_accept     = NULL;
host_item *sender_host_accept_hosts = NULL;
char  *sender_host_accept_relay = NULL;
host_item *sender_host_accept_relay_hosts = NULL;
char  *sender_host_address    = NULL;
char  *sender_host_name       = NULL;
BOOL   sender_host_notsocket  = FALSE;
char  *sender_host_reject     = NULL;
char  *sender_host_reject_except = NULL;
host_item *sender_host_reject_hosts = NULL;
host_item *sender_host_reject_except_hosts = NULL;
char  *sender_host_reject_recipients = NULL;
host_item *sender_host_reject_recipients_hosts = NULL;
char  *sender_host_reject_relay = NULL;
host_item *sender_host_reject_relay_hosts = NULL;
char  *sender_host_reject_relay_except = NULL;
host_item *sender_host_reject_relay_except_hosts = NULL;
BOOL   sender_host_unknown    = FALSE;
char  *sender_ident           = NULL;
BOOL   sender_local           = FALSE;
char  *sender_net_accept      = NULL;
ip_net_item *sender_net_accept_nets = NULL;
char  *sender_net_accept_relay = NULL;
ip_net_item *sender_net_accept_relay_nets = NULL;
char  *sender_net_reject      = NULL;
char  *sender_net_reject_except = NULL;
ip_net_item *sender_net_reject_nets = NULL;
ip_net_item *sender_net_reject_except_nets = NULL;
char  *sender_net_reject_recipients = NULL;
ip_net_item *sender_net_reject_recipients_nets = NULL;
char  *sender_net_reject_relay = NULL;
ip_net_item *sender_net_reject_relay_nets = NULL;
char  *sender_net_reject_relay_except = NULL;
ip_net_item *sender_net_reject_relay_except_nets = NULL;
char  *sender_rcvhost         = NULL;
char  *sender_reject          = NULL;
char  *sender_reject_except   = NULL;
char  *sender_reject_recipients = NULL;
BOOL   sender_try_verify      = FALSE;
char  *sender_unqualified_hosts = NULL;
host_item *sender_unqualified_hostlist = NULL;
char  *sender_unqualified_nets = NULL;
ip_net_item *sender_unqualified_netlist = NULL;
BOOL   sender_verify          = FALSE;
BOOL   sender_verify_batch    = TRUE;
char  *sender_verify_except_hosts = NULL;
host_item *sender_verify_except_hostlist = NULL;
char  *sender_verify_except_nets = NULL;
ip_net_item *sender_verify_except_netlist = NULL;
BOOL   sender_verify_fixup    = FALSE;
BOOL   sender_verify_log_details = FALSE;
BOOL   sender_verify_reject   = TRUE;
int    sender_verify_max_retry_rate = 12;
volatile BOOL sigalrm_seen    = FALSE;
char **sighup_argv            = NULL;
int    smtp_accept_count      = 0;
BOOL   smtp_accept_keepalive  = TRUE;
int    smtp_accept_max        = 20;
int    smtp_accept_max_per_host = 0;
int    smtp_accept_queue      = 0;
int    smtp_accept_queue_per_connection = 10;
int    smtp_accept_reserve    = 0;
char  *smtp_banner            = "${primary_hostname} ESMTP "
                            "Exim ${version_number} #${compile_number} "
                            "${tod_full}"
			    "\0<---------------Space to patch smtp_banner->";
BOOL   smtp_batched_input     = FALSE;
BOOL   smtp_check_spool_space = TRUE;
int    smtp_connect_backlog   = 5;
FILE  *smtp_in                = NULL;
BOOL   smtp_input             = FALSE;
int    smtp_load_reserve      = -1;
FILE  *smtp_out               = NULL;
int    smtp_port              = -1;
BOOL   smtp_reading_data      = FALSE;
int    smtp_receive_timeout   = 5*60;
char  *smtp_etrn_command      = NULL;
host_item *smtp_etrn_hostlist = NULL;
char  *smtp_etrn_hosts        = NULL;
ip_net_item *smtp_etrn_netlist = NULL;
char  *smtp_etrn_nets         = NULL;
BOOL   smtp_etrn_serialize    = TRUE;
host_item *smtp_expn_hostlist = NULL;
char  *smtp_expn_hosts        = NULL;
ip_net_item *smtp_expn_netlist = NULL;
char  *smtp_expn_nets         = NULL;
host_item *smtp_reserve_hostlist = NULL;
char  *smtp_reserve_hosts     = NULL;
ip_net_item *smtp_reserve_netlist = NULL;
char  *smtp_reserve_nets      = NULL;
BOOL   smtp_use_size          = FALSE;
BOOL   smtp_verify            = FALSE;
BOOL   split_spool_directory  = FALSE;
char  *spool_directory        = SPOOL_DIRECTORY
			  "\0<--------------Space to patch spool_directory->";
char  *stderr_filename        = STDERR_FILE
                          "\0<--------------Space to patch stderr_filename->";

int    store_max_malloc       = 0;
int    store_pool             = POOL_MAIN;
BOOL   strip_excess_angle_brackets = FALSE;
BOOL   strip_trailing_dot     = FALSE;

transport_instance *transport_address_directory = NULL;
transport_instance *transport_address_directory2 = NULL;
transport_instance *transport_address_file = NULL;
transport_instance *transport_address_pipe = NULL;
transport_instance *transport_address_reply = NULL;
transport_instance *transports = NULL;

transport_instance *transport_message_filter_directory = NULL;
transport_instance *transport_message_filter_directory2 = NULL;
transport_instance *transport_message_filter_file = NULL;
transport_instance *transport_message_filter_pipe = NULL;
transport_instance *transport_message_filter_reply = NULL;


transport_instance transport_defaults = {
   NULL,                     /* chain pointer */
   NULL,                     /* name */
   NULL,                     /* info */
   NULL,                     /* private options block pointer */
   NULL,                     /* driver name */
   NULL,                     /* setup entry point */
   local_batch_off,          /* local_batch */
   local_smtp_off,           /* local_smtp */
   100,                      /* batch_max */
   FALSE,                    /* uid_set */
   FALSE,                    /* gid_set */
   (uid_t)(-1),              /* uid */
   (gid_t)(-1),              /* gid */
   NULL,                     /* expand_uid */
   NULL,                     /* expand_gid */
   NULL,                     /* home_dir */
   NULL,                     /* current_dir */
   NULL,                     /* warn_message */
   FALSE,                    /* deliver_as_creator */
   FALSE,                    /* initgroups */
   FALSE,                    /* bsmtp_helo */
   TRUE,                     /* multi-domain */
   FALSE,                    /* overrides_hosts */
   NULL,                     /* shadow */
   NULL,                     /* shadow_condition */
   NULL,                     /* filter_command */
   NULL,                     /* add_headers */
   NULL,                     /* remove_headers */
   NULL,                     /* return_path */
   NULL,                     /* debug_string */
   FALSE,                    /* body_only */
   FALSE,                    /* delivery_date_add */
   FALSE,                    /* envelope_to_add */
   FALSE,                    /* headers_only */
   FALSE,                    /* return_path_add */
   FALSE,                    /* return_output */
   FALSE,                    /* return_fail_output */
   FALSE,                    /* log_output */
   FALSE,                    /* log_fail_output */
   FALSE,                    /* log_defer_output */
   2,                        /* BOOL, but set neither 1 nor 0 so can detect */
   100,                      /* max_addresses */
   0                         /* message_size_limit */
};

int    transport_count;
char **transport_filter_argv  = NULL;
int    transport_write_timeout= 0;

tree_node *tree_duplicates    = NULL;
tree_node *tree_nonrecipients = NULL;
tree_node *tree_unusable      = NULL;

BOOL   trusted_caller         = FALSE;
gid_t *trusted_groups         = NULL;
uid_t *trusted_users          = NULL;

char  *unknown_login          = NULL;
char  *unknown_username       = NULL;
char  *user_login             = NULL;
char  *user_name              = NULL;
BOOL   user_null_sender       = FALSE;

/* A regex for matching a "From_" line in an incoming message, in the form

   From ph10 Fri Jan  5 12:35 GMT 1996

which the "mail" commands send to the MTA (undocumented, of course), or in
the form

   From ph10 Fri, 7 Jan 97 14:00:00 GMT

which is apparently used by some UUCPs, despite it not being in RFC 976.
Because of variations in time formats, just match up to the minutes. That
should be sufficient. Examples have been seen of time fields like 12:1:03,
so just require one digit for hours and minutes. The weekday is also absent
in some forms. */

char  *uucp_from_pattern      =
  "^From\\s+(\\S+)\\s+(?:[a-zA-Z]{3},?\\s+)?"    /* Common start */
  "(?:"                                          /* Non-extracting bracket */
  "[a-zA-Z]{3}\\s+\\d?\\d|"                      /* First form */
  "\\d?\\d\\s+[a-zA-Z]{3}\\s+\\d\\d(?:\\d\\d)?"  /* Second form */
  ")"                                            /* End alternation */
  "\\s+\\d\\d?:\\d\\d?";                         /* Start of time */

char  *uucp_from_sender       = "$1";

char  *warnmsg_delay          = NULL;
char  *warnmsg_file           = NULL;
char  *warnmsg_recipients     = NULL;

char  *verify_address_parse_error = NULL;
char  *verify_forced_errmsg   = NULL;
BOOL   verify_only            = FALSE;
char  *version_copyright      = "Copyright (c) University of Cambridge 1999";
char  *version_date           = "?";
char  *version_cnumber        = "????";
char  *version_string         = "?";

int    warning_count          = 0;

/* End of globals.c */
