setup a check to warn users about certain config

If I am not mistaken, the configuration I am checking for is the one we
should emit a warning about: in case junk mail is moved to the inbox and
no rewriting happens, we should check whether this is actually what the
user wants.
This commit is contained in:
georglauterbach 2024-01-25 18:16:54 +01:00
parent bc6786ec87
commit 7372fae786
No known key found for this signature in database
GPG Key ID: F367F7C43C118578
2 changed files with 10 additions and 0 deletions

View File

@ -36,6 +36,7 @@ function _register_functions() {
_register_check_function '_check_improper_restart' _register_check_function '_check_improper_restart'
_register_check_function '_check_hostname' _register_check_function '_check_hostname'
_register_check_function '_check_log_level' _register_check_function '_check_log_level'
_register_check_function '_check_spam_prefix'
# ? >> Setup # ? >> Setup

View File

@ -52,3 +52,12 @@ function _check_log_level() {
LOG_LEVEL="${DEFAULT_LOG_LEVEL}" LOG_LEVEL="${DEFAULT_LOG_LEVEL}"
fi fi
} }
function _check_spam_prefix() {
# This check should be independent of ENABLE_POP3 and ENABLE_IMAP
if _env_var_expect_zero_or_one MOVE_SPAM_TO_JUNK \
&& [[ ${MOVE_SPAM_TO_JUNK} -eq 0 ]] \
&& [[ -z ${SPAM_SUBJECT} ]]; then
_log 'warn' "'MOVE_SPAM_TO_JUNK=0' and 'SPAM_SUBJECT' is empty - make sure this is intended: spam e-mails might not be immediately recognizable in this configuration"
fi
}