| 1 | /************************************************* |
| 2 | * Exim Monitor * |
| 3 | *************************************************/ |
| 4 | |
| 5 | /* Copyright (c) University of Cambridge 1995 - 2018 */ |
| 6 | /* See the file NOTICE for conditions of use and distribution. */ |
| 7 | |
| 8 | |
| 9 | #include "em_hdr.h" |
| 10 | |
| 11 | /* This source module contains all the global variables used in |
| 12 | the exim monitor, including those that are used by the standard |
| 13 | Exim modules that are included in Eximon. For comments on their |
| 14 | usage, see em_hdr.h and globals.h. */ |
| 15 | |
| 16 | |
| 17 | /* The first set are unique to Eximon */ |
| 18 | |
| 19 | Display *X_display; |
| 20 | XtAppContext X_appcon; |
| 21 | |
| 22 | XtActionsRec actionTable[] = { |
| 23 | { "dialogAction", (XtActionProc)dialogAction}}; |
| 24 | |
| 25 | int actionTableSize = sizeof(actionTable)/sizeof(XtActionsRec); |
| 26 | |
| 27 | XtTranslations queue_trans; |
| 28 | XtTranslations text_trans; |
| 29 | |
| 30 | Widget dialog_ref_widget; |
| 31 | Widget toplevel_widget; |
| 32 | Widget log_widget = NULL; |
| 33 | Widget queue_widget; |
| 34 | Widget unhide_widget = NULL; |
| 35 | |
| 36 | |
| 37 | FILE *LOG; |
| 38 | |
| 39 | int action_output = FALSE; |
| 40 | int action_queue_update = TRUE; |
| 41 | uschar actioned_message[24]; |
| 42 | uschar *action_required; |
| 43 | uschar *alternate_config = NULL; |
| 44 | |
| 45 | #ifdef EXPERIMENTAL_BRIGHTMAIL |
| 46 | int bmi_run = 0; |
| 47 | uschar *bmi_verdicts = NULL; |
| 48 | #endif |
| 49 | |
| 50 | int body_max = 20000; |
| 51 | |
| 52 | uschar *exim_path = US BIN_DIRECTORY "/exim" |
| 53 | "\0<---------------Space to patch exim_path->"; |
| 54 | |
| 55 | int eximon_initialized = FALSE; |
| 56 | |
| 57 | int log_buffer_size = 10240; |
| 58 | BOOL log_datestamping = FALSE; |
| 59 | int log_depth = 150; |
| 60 | uschar *log_display_buffer; |
| 61 | uschar *log_file = NULL; |
| 62 | uschar log_file_open[256]; |
| 63 | uschar *log_font = NULL; |
| 64 | ino_t log_inode; |
| 65 | long int log_position; |
| 66 | int log_width = 600; |
| 67 | |
| 68 | uschar *menu_event = US"Shift<Btn1Down>"; |
| 69 | int menu_is_up = FALSE; |
| 70 | int min_height = 162; |
| 71 | int min_width = 103; |
| 72 | |
| 73 | pipe_item *pipe_chain = NULL; |
| 74 | |
| 75 | uschar *qualify_domain = NULL; |
| 76 | int queue_depth = 200; |
| 77 | uschar *queue_font = NULL; |
| 78 | int queue_max_addresses = 10; |
| 79 | skip_item *queue_skip = NULL; |
| 80 | uschar *queue_stripchart_name = NULL; |
| 81 | int queue_update = 60; |
| 82 | int queue_width = 600; |
| 83 | |
| 84 | pcre *yyyymmdd_regex; |
| 85 | |
| 86 | uschar *size_stripchart = NULL; |
| 87 | uschar *size_stripchart_name = NULL; |
| 88 | int spool_is_split = FALSE; |
| 89 | int start_small = FALSE; |
| 90 | int stripchart_height = 90; |
| 91 | int stripchart_number = 1; |
| 92 | pcre **stripchart_regex; |
| 93 | uschar **stripchart_title; |
| 94 | int *stripchart_total; |
| 95 | int stripchart_update = 60; |
| 96 | int stripchart_width = 80; |
| 97 | int stripchart_varstart = 1; |
| 98 | |
| 99 | int text_depth = 200; |
| 100 | int tick_queue_accumulator = 999999; |
| 101 | |
| 102 | uschar *window_title = US"exim monitor"; |
| 103 | |
| 104 | |
| 105 | /***********************************************************/ |
| 106 | /***********************************************************/ |
| 107 | |
| 108 | |
| 109 | /* These ones are used by Exim modules included in Eximon. Not all are |
| 110 | actually relevant to the operation of Eximon. If SPOOL_DIRECTORY is not |
| 111 | defined (Exim was compiled with it unset), just define it empty. The script |
| 112 | that fires up the monitor fishes the value out by using -bP anyway. */ |
| 113 | |
| 114 | #ifndef SPOOL_DIRECTORY |
| 115 | #define SPOOL_DIRECTORY "" |
| 116 | #endif |
| 117 | |
| 118 | tree_node *acl_var_c = NULL; |
| 119 | tree_node *acl_var_m = NULL; |
| 120 | uschar *active_hostname = NULL; |
| 121 | BOOL allow_unqualified_recipient = FALSE; |
| 122 | BOOL allow_unqualified_sender = FALSE; |
| 123 | uschar *authenticated_id = NULL; |
| 124 | uschar *authenticated_sender = NULL; |
| 125 | |
| 126 | uschar *big_buffer = NULL; |
| 127 | int big_buffer_size = BIG_BUFFER_SIZE; |
| 128 | int body_linecount = 0; |
| 129 | int body_zerocount = 0; |
| 130 | |
| 131 | BOOL deliver_firsttime = FALSE; |
| 132 | BOOL deliver_freeze = FALSE; |
| 133 | time_t deliver_frozen_at = 0; |
| 134 | BOOL deliver_manual_thaw = FALSE; |
| 135 | |
| 136 | #ifndef DISABLE_DKIM |
| 137 | uschar *dkim_cur_signer = NULL; |
| 138 | uschar *dkim_signers = NULL; |
| 139 | uschar *dkim_signing_domain = NULL; |
| 140 | uschar *dkim_signing_selector = NULL; |
| 141 | uschar *dkim_verify_signers = US"$dkim_signers"; |
| 142 | unsigned dkim_collect_input = 0; |
| 143 | BOOL dkim_disable_verify = FALSE; |
| 144 | #endif |
| 145 | |
| 146 | BOOL dont_deliver = FALSE; |
| 147 | |
| 148 | int dsn_ret = 0; |
| 149 | uschar *dsn_envid = NULL; |
| 150 | |
| 151 | struct global_flags f = { |
| 152 | .sender_local = FALSE, |
| 153 | }; |
| 154 | |
| 155 | #ifdef WITH_CONTENT_SCAN |
| 156 | int fake_response = OK; |
| 157 | #endif |
| 158 | |
| 159 | header_line *header_last = NULL; |
| 160 | header_line *header_list = NULL; |
| 161 | |
| 162 | BOOL host_lookup_deferred = FALSE; |
| 163 | BOOL host_lookup_failed = FALSE; |
| 164 | uschar *interface_address = NULL; |
| 165 | int interface_port = 0; |
| 166 | |
| 167 | BOOL local_error_message = FALSE; |
| 168 | uschar *local_scan_data = NULL; |
| 169 | BOOL log_timezone = FALSE; |
| 170 | |
| 171 | #ifdef WITH_CONTENT_SCAN |
| 172 | uschar *spam_bar = NULL; |
| 173 | uschar *spam_report = NULL; |
| 174 | uschar *spam_score = NULL; |
| 175 | uschar *spam_score_int = NULL; |
| 176 | #endif |
| 177 | |
| 178 | int max_received_linelength= 0; |
| 179 | int message_age = 0; |
| 180 | uschar *message_id; |
| 181 | uschar *message_id_external; |
| 182 | uschar message_id_option[MESSAGE_ID_LENGTH + 3]; |
| 183 | |
| 184 | int message_linecount = 0; |
| 185 | int message_size = 0; |
| 186 | uschar message_subdir[2] = { 0, 0 }; |
| 187 | |
| 188 | gid_t originator_gid; |
| 189 | uschar *originator_login; |
| 190 | uid_t originator_uid; |
| 191 | |
| 192 | uschar *primary_hostname = NULL; |
| 193 | |
| 194 | uschar *queue_name = US""; |
| 195 | |
| 196 | int received_count = 0; |
| 197 | uschar *received_protocol = NULL; |
| 198 | struct timeval received_time = { 0, 0 }; |
| 199 | int recipients_count = 0; |
| 200 | recipient_item *recipients_list = NULL; |
| 201 | int recipients_list_max = 0; |
| 202 | BOOL running_in_test_harness=FALSE; |
| 203 | |
| 204 | uschar *sender_address = NULL; |
| 205 | uschar *sender_fullhost = NULL; |
| 206 | uschar *sender_helo_name = NULL; |
| 207 | uschar *sender_host_address = NULL; |
| 208 | uschar *sender_host_authenticated = NULL; |
| 209 | uschar *sender_host_name = NULL; |
| 210 | int sender_host_port = 0; |
| 211 | uschar *sender_ident = NULL; |
| 212 | BOOL sender_set_untrusted = FALSE; |
| 213 | uschar *smtp_active_hostname = NULL; |
| 214 | |
| 215 | BOOL split_spool_directory = FALSE; |
| 216 | uschar *spool_directory = US SPOOL_DIRECTORY; |
| 217 | int string_datestamp_offset=-1; |
| 218 | int string_datestamp_length= 0; |
| 219 | int string_datestamp_type = -1; |
| 220 | |
| 221 | BOOL timestamps_utc = FALSE; |
| 222 | tls_support tls_in = { |
| 223 | {-1}, /* tls_active */ |
| 224 | 0, /* bits */ |
| 225 | FALSE, /* tls_certificate_verified */ |
| 226 | #ifdef SUPPORT_DANE |
| 227 | FALSE, /* dane_verified */ |
| 228 | 0, /* tlsa_usage */ |
| 229 | #endif |
| 230 | NULL, /* tls_cipher */ |
| 231 | FALSE, /* tls_on_connect */ |
| 232 | NULL, /* tls_on_connect_ports */ |
| 233 | NULL, /* tls_peerdn */ |
| 234 | NULL /* tls_sni */ |
| 235 | }; |
| 236 | |
| 237 | tree_node *tree_duplicates = NULL; |
| 238 | tree_node *tree_nonrecipients = NULL; |
| 239 | tree_node *tree_unusable = NULL; |
| 240 | |
| 241 | uschar *version_date = US"?"; |
| 242 | uschar *version_string = US"?"; |
| 243 | |
| 244 | int warning_count = 0; |
| 245 | |
| 246 | /* End of em_globals.c */ |