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