From 99776c1513db4a58ba4c901e803f6fa3f3a19038 Mon Sep 17 00:00:00 2001 From: John Supplee Date: Sat, 9 Mar 2019 12:11:41 +0200 Subject: [PATCH] Disable Postgrey service if it is not being used --- setup/mail-postfix.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup/mail-postfix.sh b/setup/mail-postfix.sh index c4cd1022..9ec35518 100755 --- a/setup/mail-postfix.sh +++ b/setup/mail-postfix.sh @@ -231,7 +231,7 @@ tools/editconf.py /etc/default/postgrey \ tools/editconf.py /etc/postfix/main.cf \ message_size_limit=134217728 -if [ $POSTSRSD == "1" ]; then +if [ $POSTSRSD == 1 ]; then # Setup SRS postconf -e \ sender_canonical_maps=tcp:localhost:10001 \ @@ -262,4 +262,13 @@ ufw_allow submission # Restart services restart_service postfix + +if [ $POSTGREY == 1 ]; then + hide_output systemctl enable postgrey + hide_output systemctl restart postgrey +else + hide_output systemctl disable postgrey + hide_output systemctl stop postgrey +fi + restart_service postgrey