Check that spamassassin is installed

This commit is contained in:
Bob Mottram 2016-01-04 16:01:31 +00:00
parent 494ffdbc98
commit b3dcf0e172
1 changed files with 8 additions and 4 deletions

View File

@ -4455,6 +4455,10 @@ function spam_filtering {
apt-get -y install exim4-daemon-heavy
apt-get -y install spamassassin
sa-update -v
if [ ! -f /etc/default/spamassassin ]; then
echo 'Spamassassin was not installed'
exit 72570
fi
sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/spamassassin
sed -i 's/# spamd_address = 127.0.0.1 783/spamd_address = 127.0.0.1 783/g' /etc/exim4/exim4.conf.template
# This configuration is based on https://wiki.debian.org/DebianSpamAssassin
@ -4598,9 +4602,9 @@ function spam_filtering {
# this must be accessible by root
chown -R $MY_USERNAME:root /home/$MY_USERNAME/.spamassassin
service spamassassin restart
service exim4 restart
service cron restart
systemctl restart spamassassin
systemctl restart exim4
systemctl restart cron
echo 'spam_filtering' >> $COMPLETION_FILE
}
@ -5648,7 +5652,7 @@ function install_web_server {
if grep -q "Nginx-ensite commit" $COMPLETION_FILE; then
CURRENT_NGINX_ENSITE_COMMIT=$(grep "Nginx-ensite commit" $COMPLETION_FILE | awk -F ':' '{print $2}')
if [[ "$CURRENT_NGINX_ENSITE_COMMIT" != "$NGINX_ENSITE_COMMIT" ]]; then
$INSTALL_DIR/nginx_ensite
$INSTALL_DIR/nginx_ensite
git stash
git checkout master
git pull