yunohost/data/hooks/conf_regen/22-email-legacy
2016-03-08 14:12:41 +01:00

33 lines
1.1 KiB
Bash

#!/bin/bash
set -e
# Execute this hook only if we force the configuration regeneration
if [[ "$1" == "True" ]]; then
# Add new email services
sudo yunohost service add rspamd -l /var/log/mail.log \
|| echo "Rspamd is already listed in services"
sudo yunohost service add rmilter -l /var/log/mail.log \
|| echo "Rmilter is already listed in services"
sudo yunohost service add redis-server -l /var/log/redis/redis-server.log \
|| echo "redis-server is already listed in services"
# Remove previous email services
sudo yunohost service remove spamassassin \
|| echo "Spamassassin is already removed"
sudo systemctl disable spamassassin || true
sudo systemctl stop spamassassin || true
sudo rm -f etc/cron.daily/spamassassin
sudo yunohost service remove amavis \
|| echo "Amavis is already removed"
sudo systemctl disable amavis || true
sudo systemctl stop amavis || true
sudo yunohost service remove postgrey \
|| echo "Postgrey is already removed" \
sudo systemctl disable postgrey || true
sudo systemctl stop postgrey || true
fi