[Update, Config] Add subject for watchdog emails (#4027)
Co-authored-by: Valentin <vbrandner.itsb-b2018@fh-salzburg.ac.at>master
parent
4feceb08da
commit
3255c08813
|
@ -109,7 +109,7 @@ function mail_error() {
|
||||||
SUBJECT="${BODY}"
|
SUBJECT="${BODY}"
|
||||||
BODY="Please see netfilter-mailcow for more details and triggered rules."
|
BODY="Please see netfilter-mailcow for more details and triggered rules."
|
||||||
else
|
else
|
||||||
SUBJECT="Watchdog ALERT: ${1}"
|
SUBJECT="${WATCHDOG_SUBJECT}: ${1}"
|
||||||
fi
|
fi
|
||||||
IFS=',' read -r -a MAIL_RCPTS <<< "${WATCHDOG_NOTIFY_EMAIL}"
|
IFS=',' read -r -a MAIL_RCPTS <<< "${WATCHDOG_NOTIFY_EMAIL}"
|
||||||
for rcpt in "${MAIL_RCPTS[@]}"; do
|
for rcpt in "${MAIL_RCPTS[@]}"; do
|
||||||
|
|
|
@ -437,6 +437,7 @@ services:
|
||||||
- USE_WATCHDOG=${USE_WATCHDOG:-n}
|
- USE_WATCHDOG=${USE_WATCHDOG:-n}
|
||||||
- WATCHDOG_NOTIFY_EMAIL=${WATCHDOG_NOTIFY_EMAIL}
|
- WATCHDOG_NOTIFY_EMAIL=${WATCHDOG_NOTIFY_EMAIL}
|
||||||
- WATCHDOG_NOTIFY_BAN=${WATCHDOG_NOTIFY_BAN:-y}
|
- WATCHDOG_NOTIFY_BAN=${WATCHDOG_NOTIFY_BAN:-y}
|
||||||
|
- WATCHDOG_SUBJECT=${WATCHDOG_SUBJECT:-Watchdog ALERT}
|
||||||
- WATCHDOG_EXTERNAL_CHECKS=${WATCHDOG_EXTERNAL_CHECKS:-n}
|
- WATCHDOG_EXTERNAL_CHECKS=${WATCHDOG_EXTERNAL_CHECKS:-n}
|
||||||
- WATCHDOG_MYSQL_REPLICATION_CHECKS=${WATCHDOG_MYSQL_REPLICATION_CHECKS:-n}
|
- WATCHDOG_MYSQL_REPLICATION_CHECKS=${WATCHDOG_MYSQL_REPLICATION_CHECKS:-n}
|
||||||
- MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
|
- MAILCOW_HOSTNAME=${MAILCOW_HOSTNAME}
|
||||||
|
|
|
@ -279,6 +279,9 @@ USE_WATCHDOG=y
|
||||||
# Notify about banned IP (includes whois lookup)
|
# Notify about banned IP (includes whois lookup)
|
||||||
WATCHDOG_NOTIFY_BAN=n
|
WATCHDOG_NOTIFY_BAN=n
|
||||||
|
|
||||||
|
# Subject for watchdog mails. Defaults to "Watchdog ALERT" followed by the error message.
|
||||||
|
#WATCHDOG_SUBJECT=
|
||||||
|
|
||||||
# Checks if mailcow is an open relay. Requires a SAL. More checks will follow.
|
# Checks if mailcow is an open relay. Requires a SAL. More checks will follow.
|
||||||
# https://www.servercow.de/mailcow?lang=en
|
# https://www.servercow.de/mailcow?lang=en
|
||||||
# https://www.servercow.de/mailcow?lang=de
|
# https://www.servercow.de/mailcow?lang=de
|
||||||
|
|
|
@ -191,6 +191,7 @@ CONFIG_ARRAY=(
|
||||||
"WATCHDOG_NOTIFY_EMAIL"
|
"WATCHDOG_NOTIFY_EMAIL"
|
||||||
"WATCHDOG_NOTIFY_BAN"
|
"WATCHDOG_NOTIFY_BAN"
|
||||||
"WATCHDOG_EXTERNAL_CHECKS"
|
"WATCHDOG_EXTERNAL_CHECKS"
|
||||||
|
"WATCHDOG_SUBJECT"
|
||||||
"SKIP_CLAMD"
|
"SKIP_CLAMD"
|
||||||
"SKIP_IP_CHECK"
|
"SKIP_IP_CHECK"
|
||||||
"ADDITIONAL_SAN"
|
"ADDITIONAL_SAN"
|
||||||
|
@ -361,6 +362,12 @@ for option in ${CONFIG_ARRAY[@]}; do
|
||||||
echo '# Notify about banned IP. Includes whois lookup.' >> mailcow.conf
|
echo '# Notify about banned IP. Includes whois lookup.' >> mailcow.conf
|
||||||
echo "WATCHDOG_NOTIFY_BAN=y" >> mailcow.conf
|
echo "WATCHDOG_NOTIFY_BAN=y" >> mailcow.conf
|
||||||
fi
|
fi
|
||||||
|
elif [[ ${option} == "WATCHDOG_SUBJECT" ]]; then
|
||||||
|
if ! grep -q ${option} mailcow.conf; then
|
||||||
|
echo "Adding new option \"${option}\" to mailcow.conf"
|
||||||
|
echo '# Subject for watchdog mails. Defaults to "Watchdog ALERT" followed by the error message.' >> mailcow.conf
|
||||||
|
echo "#WATCHDOG_SUBJECT=" >> mailcow.conf
|
||||||
|
fi
|
||||||
elif [[ ${option} == "WATCHDOG_EXTERNAL_CHECKS" ]]; then
|
elif [[ ${option} == "WATCHDOG_EXTERNAL_CHECKS" ]]; then
|
||||||
if ! grep -q ${option} mailcow.conf; then
|
if ! grep -q ${option} mailcow.conf; then
|
||||||
echo "Adding new option \"${option}\" to mailcow.conf"
|
echo "Adding new option \"${option}\" to mailcow.conf"
|
||||||
|
|
Loading…
Reference in New Issue