summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.d
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_smtp.d')
-rw-r--r--plugins/check_smtp.d/config.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/plugins/check_smtp.d/config.h b/plugins/check_smtp.d/config.h
new file mode 100644
index 00000000..b0d42ed1
--- /dev/null
+++ b/plugins/check_smtp.d/config.h
@@ -0,0 +1,96 @@
1#pragma once
2
3#include "../../config.h"
4#include "output.h"
5#include "thresholds.h"
6#include <stddef.h>
7#include <string.h>
8
9enum {
10 SMTP_PORT = 25,
11 SMTPS_PORT = 465
12};
13
14#define SMTP_EXPECT "220"
15
16typedef struct {
17 int server_port;
18 char *server_address;
19 char *localhostname;
20 char *server_expect;
21 bool ignore_send_quit_failure;
22
23 mp_thresholds connection_time;
24
25 bool use_ehlo;
26 bool use_lhlo;
27
28 char *from_arg;
29 bool send_mail_from;
30
31 unsigned long ncommands;
32 char **commands;
33
34 unsigned long nresponses;
35 char **responses;
36
37 char *authtype;
38 char *authuser;
39 char *authpass;
40
41 bool use_proxy_prefix;
42#ifdef HAVE_SSL
43 int days_till_exp_warn;
44 int days_till_exp_crit;
45 bool use_ssl;
46 bool use_starttls;
47 bool use_sni;
48
49 bool ignore_certificate_expiration;
50#endif
51
52 bool output_format_is_set;
53 mp_output_format output_format;
54} check_smtp_config;
55
56check_smtp_config check_smtp_config_init() {
57 check_smtp_config tmp = {
58 .server_port = SMTP_PORT,
59 .server_address = NULL,
60 .localhostname = NULL,
61
62 .server_expect = SMTP_EXPECT,
63 .ignore_send_quit_failure = false,
64
65 .connection_time = mp_thresholds_init(),
66 .use_ehlo = false,
67 .use_lhlo = false,
68
69 .from_arg = strdup(" "),
70 .send_mail_from = false,
71
72 .ncommands = 0,
73 .commands = NULL,
74
75 .nresponses = 0,
76 .responses = NULL,
77
78 .authtype = NULL,
79 .authuser = NULL,
80 .authpass = NULL,
81
82 .use_proxy_prefix = false,
83#ifdef HAVE_SSL
84 .days_till_exp_warn = 0,
85 .days_till_exp_crit = 0,
86 .use_ssl = false,
87 .use_starttls = false,
88 .use_sni = false,
89
90 .ignore_certificate_expiration = false,
91#endif
92
93 .output_format_is_set = false,
94 };
95 return tmp;
96}