#!/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_10_info() { echo "Add ufw rule for WebUI (11334)"; } step_10_alias() { echo "ufw"; } step_10() { exe ufw allow 11334/tcp comment "rspamd WebUI" } step_50_info() { echo "Notes"; } step_50_alias() { echo "notes"; } step_50() { color green cat < enable_password = [/etc/rspamd/local.d/redis.conf] server = "127.0.0.1"; timeout = 3s; [/etc/rspamd/local.d/classifier-bayes.conf] backend = "redis"; autolearn = true; [/etc/rspamd/local.d/dkim_signing.conf] enabled = false; [/etc/rspamd/local.d/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 = <