From 4b2cef091db45a235b2615d9e22de2319f067601 Mon Sep 17 00:00:00 2001 From: Martin Winkler Date: Sun, 13 Nov 2022 18:38:29 +0100 Subject: [PATCH] rspamd - Very basic installation and notes seq librenms - fix variable name --- seqs/librenms.sh | 2 +- seqs/rspamd.sh | 237 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+), 1 deletion(-) create mode 100755 seqs/rspamd.sh diff --git a/seqs/librenms.sh b/seqs/librenms.sh index 3d7a324..f94c46b 100755 --- a/seqs/librenms.sh +++ b/seqs/librenms.sh @@ -41,7 +41,7 @@ step_1() { } step_2_info() { - echo "Installing $toolname dependencies:" + echo "Installing $toolName dependencies:" echoinfo "$libreDeps" } step_2() { diff --git a/seqs/rspamd.sh b/seqs/rspamd.sh new file mode 100755 index 0000000..f8672ec --- /dev/null +++ b/seqs/rspamd.sh @@ -0,0 +1,237 @@ +#!/usr/bin/env bash + +readonly toolName=rspamd + +# Already defined by sequencer.sh, but may be overwritten +#readonly seq_configName="${sq_scriptName:?}.cfg" +#readonly seq_configTemplate="${seq_origin:?}/${sq_configName:?}.example" + +sq_aptOpt= +sq_config=0 + +seq_config() { + ## Called once before executing steps. + ## e.g. to source a config file manually: + #. "${seq_origin:?}/${seq_configName:?}" + + ## or to use sequencer api with profile config file support: + #if initSeqConfig -p "${seq_fileName:?}" "${seq_configTemplate:?}" ; then + + ## or to use sequencer api with global config file: + #if initSeqConfig "${seq_configName:?}" "${seq_configTemplate:?}" ; then + # sq_config=1 + #else + # # End if no configuration file exists + # dry || return 1 + #fi + + ## Apt cmdline option to suppress user interaction + interactive || sq_aptOpt="-y" + + ## Disable error checks if external scripts are used + ## e.g. error on unbound variables + #disableErrorCheck + + ## Return of non zero value will abort the sequence + return 0 +} + +step_1_info() { echo "Setup custom repository for raspberry pi OS"; } +step_1_alias() { echo "install"; } +step_1() { + local lRaspbianRelease="Raspbian_$(lsb_release -sr)" + local lFileName="home_susenerf_rspamd-exotic-debian" + local lRepoUrl="http://download.opensuse.org/repositories/home:/susenerf:/rspamd-exotic-debian" + exep echo "deb ${lRepoUrl}/${lRaspbianRelease}/ /" "|" sudo tee /etc/apt/sources.list.d/${lFileName}.list + exep curl -fsSL "${lRepoUrl}/${lRaspbianRelease}/Release.key" "|" gpg --dearmor "|" sudo tee /etc/apt/trusted.gpg.d/${lFileName}.gpg ">" /dev/null + exe apt update +} + +step_2_info() { echo "Install ${toolName} with apt"; } +step_2() { + exe apt install rspamd redis-server +} + +step_50_info() { echo "Notes"; } +step_50_alias() { echo "notes"; } +step_50() { + color green + cat < + enable_password = + + [/etc/rspamd/local.c/redis.conf] + server = "127.0.0.1"; + timeout = 3s; + + [/etc/rspamd/local.c/classifier-bayes.conf] + backend = "redis"; + autolearn = true; + + [/etc/rspamd/local.c/dkim_signing.conf] + enabled = false; + + [/etc/rspamd/local.c/milter_headers.conf] + authenticated_headers = ["authentication-results"]; + use = ["x-spamd-result","x-spam-level","x-spamd-bar", "my-x-spam-score","x-spam-status", "authentication-results"]; + + # add X-Spam-Score header (like SA does) + # Source: https://groups.google.com/forum/#!topic/rspamd/fEdbnG0J18I + custom { + my-x-spam-score = <