From 32fc4122bd144f1cfef9aad551d6384dde122436 Mon Sep 17 00:00:00 2001 From: Tunui Franken Date: Sat, 1 Feb 2025 21:33:15 +0100 Subject: [PATCH] [mailserver] Add submissions check --- .../templates/nftables/output.d/icinga2.conf.j2 | 2 +- .../templates/zones.d/master/services/mailserver.conf.j2 | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/icinga2_master/templates/nftables/output.d/icinga2.conf.j2 b/roles/icinga2_master/templates/nftables/output.d/icinga2.conf.j2 index 657be74..8b203a3 100644 --- a/roles/icinga2_master/templates/nftables/output.d/icinga2.conf.j2 +++ b/roles/icinga2_master/templates/nftables/output.d/icinga2.conf.j2 @@ -1,4 +1,4 @@ # {{ ansible_managed }} ip daddr {{ hostvars[icinga2_agent].ipv4_addr }} tcp dport 5665 accept comment "Allow Icinga2 to Agent" -ip daddr {{ hostvars[relayhost].ipv4_addr }} tcp dport { 22, 25, 587, 993 } accept comment "Allow some ports to check mailserver" +ip daddr {{ hostvars[relayhost].ipv4_addr }} tcp dport { 22, 25, 465, 587, 993 } accept comment "Allow some ports to check mailserver" diff --git a/roles/mailserver_monitoring/templates/zones.d/master/services/mailserver.conf.j2 b/roles/mailserver_monitoring/templates/zones.d/master/services/mailserver.conf.j2 index 572fbd3..fedd47f 100644 --- a/roles/mailserver_monitoring/templates/zones.d/master/services/mailserver.conf.j2 +++ b/roles/mailserver_monitoring/templates/zones.d/master/services/mailserver.conf.j2 @@ -6,6 +6,13 @@ apply Service "smtp" { assign where host.name == "{{ inventory_hostname }}" } +apply Service "submissions" { + import "generic-service" + check_command = "ssmtp" + assign where host.name == "{{ inventory_hostname }}" + vars.smtp_port = 465 +} + apply Service "submission" { import "generic-service" check_command = "smtp"