summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-10 20:56:09 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2025-03-10 20:56:09 +0100
commit5cf53de34fa410702ca59437cdf3f304366c3c55 (patch)
tree9ed15f44dfe6e38e7696aecbfd622e6775d5c4e2
parent897fef937096c6aae32f9cd80d7b867558596bc5 (diff)
downloadmonitoring-plugins-5cf53de34fa410702ca59437cdf3f304366c3c55.tar.gz
check_smtp: fix positional host logic
-rw-r--r--plugins/check_smtp.c2
-rw-r--r--plugins/check_smtp.d/config.h2
2 files changed, 3 insertions, 1 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 324549d4..fd492294 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -697,6 +697,8 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) {
697 } else { 697 } else {
698 usage2(_("Invalid hostname/address"), argv[c]); 698 usage2(_("Invalid hostname/address"), argv[c]);
699 } 699 }
700 } else {
701 result.config.server_address = strdup("localhost");
700 } 702 }
701 } 703 }
702 704
diff --git a/plugins/check_smtp.d/config.h b/plugins/check_smtp.d/config.h
index c8660445..0a6511ef 100644
--- a/plugins/check_smtp.d/config.h
+++ b/plugins/check_smtp.d/config.h
@@ -52,7 +52,7 @@ typedef struct {
52check_smtp_config check_smtp_config_init() { 52check_smtp_config check_smtp_config_init() {
53 check_smtp_config tmp = { 53 check_smtp_config tmp = {
54 .server_port = SMTP_PORT, 54 .server_port = SMTP_PORT,
55 .server_address = strdup("localhost"), 55 .server_address = NULL,
56 .localhostname = NULL, 56 .localhostname = NULL,
57 57
58 .server_expect = SMTP_EXPECT, 58 .server_expect = SMTP_EXPECT,