From 77f7ef93eb284856bc5d7591f5a53d15c68c2b0e Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Sat, 15 Jun 2024 11:48:26 -0700 Subject: [PATCH] update spamassassin debian vs ubuntu config --- install.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/install.sh b/install.sh index f0514fa..8e9f42a 100755 --- a/install.sh +++ b/install.sh @@ -91,20 +91,22 @@ sed -i "s|userpref|sa_userpref|g" /usr/share/doc/spamassassin/sql/userpref_mysql sed -i "s|username varchar(100)|username varchar(255)|g" /usr/share/doc/spamassassin/sql/userpref_mysql.sql sed -i "s|TYPE=MyISAM||g" /usr/share/doc/spamassassin/sql/userpref_mysql.sql mysql vmail < /usr/share/doc/spamassassin/sql/userpref_mysql.sql -if [ $os_codename = jammy ]; then - sed -i 's|OPTIONS="--create-prefs --max-children 5 --helper-home-dir"|OPTIONS="-x -q -v -u Debian-exim -m 5"|g' /etc/default/spamassassin - sed -i 's|CRON=0|CRON=1|g' /etc/default/spamassassin -elif [ $os_codename != bookworm ]; then - sed -i 's|OPTIONS="--create-prefs --max-children 5 --helper-home-dir"|OPTIONS="-x -q -v -u Debian-exim -m 5"|g' /etc/default/spamd -else - echo "WARNING: Unexpected OS codename. This should never happen due to previous checks." -fi cp etc/spamassassin/*.cf /etc/spamassassin/ sed -i "s|user_scores_sql_password password|user_scores_sql_password $VMAILPASS|g" /etc/spamassassin/sql.cf chown root:root /etc/spamassassin/local.cf chmod 644 /etc/spamassassin/local.cf -chown Debian-exim:mail /etc/spamassassin/sql.cf chmod 640 /etc/spamassassin/sql.cf +chown debian-spamd:mail /etc/spamassassin/sql.cf +if [ $os_codename = jammy ]; then + sed -i 's|OPTIONS="--create-prefs --max-children 5 --helper-home-dir"|OPTIONS="-x -q -v -u debian-spamd -g mail -m 5"|g' /etc/default/spamassassin + sed -i 's|CRON=0|CRON=1|g' /etc/default/spamassassin +elif [ $os_codename != bookworm ]; then + sed -i 's|OPTIONS="--create-prefs --max-children 5 --helper-home-dir"|OPTIONS="-x -q -v -u debian-spamd -g mail -m 5"|g' /etc/default/spamd + systemctl enable spamassassin-maintenance.timer + systemctl start spamassassin-maintenance.timer +else + echo "WARNING: Unexpected OS codename. This should never happen due to previous checks." +fi # create local systemd dir, used by srsd & vmail-cron if [[ ! -d /usr/local/lib/systemd/system ]]; then