Update target/scripts/startup/setup.d/security/rspamd.sh

Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
Hans-Cees Speel 2024-01-28 21:24:15 +01:00 committed by GitHub
parent eed8a07f2d
commit c72b6e7845
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 8 deletions

View File

@ -289,16 +289,12 @@ function __rspamd__setup_hfilter_group() {
# https://www.rspamd.com/doc/modules/neural.html). This module is experimental # https://www.rspamd.com/doc/modules/neural.html). This module is experimental
# but can enhance anti-spam scoring possibly. # but can enhance anti-spam scoring possibly.
function __rspamd__setup_neural() { function __rspamd__setup_neural() {
local MODULE_FILE="${RSPAMD_LOCAL_D}/neural.conf"
readonly MODULE_FILE
local MODULE_FILE_2="${RSPAMD_LOCAL_D}/neural_group.conf"
readonly MODULE_FILE_2
if _env_var_expect_zero_or_one 'RSPAMD_NEURAL' && [[ ${RSPAMD_NEURAL} -eq 1 ]]; then if _env_var_expect_zero_or_one 'RSPAMD_NEURAL' && [[ ${RSPAMD_NEURAL} -eq 1 ]]; then
__rspamd__log 'debug' 'neural module is enabled' __rspamd__log 'debug' 'Disabling Neural module'
else else
__rspamd__log 'debug' 'Disabling neural (group) module' __rspamd__log 'debug' 'Neural module is disabled'
rm -f "${MODULE_FILE}" rm -f "${RSPAMD_LOCAL_D}/neural.conf"
rm -f "${MODULE_FILE_2}" rm -f "${RSPAMD_LOCAL_D}/neural_group.conf"
fi fi
} }