Skip to content

Commit

Permalink
email: Only restart clamav when 'antivirus' file is present
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewladlow committed Jul 12, 2018
1 parent 2cad68a commit 684f884
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions email/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
symbiosis-email (2018:0615) stable; urgency=medium

* Set 'keep_environment' in Exim config.
* Only restart clamav in postinst when 'antivirus' file present.

-- Andrew Ladlow <andrew.ladlow@bytemark.co.uk> Fri, 15 Jun 2018 13:15:08 +0100

Expand Down
22 changes: 22 additions & 0 deletions email/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -144,5 +144,27 @@ for i in exim4 dovecot spamassassin symbiosis-email-dict-proxy symbiosis-email-p
service $i restart || true
done

#
# Only restart clamav if a domain contains an 'antivirus' file
#

antivirus_enabled=false

for domain in /srv/*; do
[ -h "$domain" ] && continue
[ ! -d "$domain" ] && continue

antivirus="$domain/config/antivirus"
if [ -e "$antivirus" ] ; then
antivirus_enabled=true
fi
done

if [ "$antivirus_enabled" = true ] ; then
for i in clamav-daemon clamav-freshclam; do
service $i restart || true
done
fi

#DEBHELPER#
exit 0

0 comments on commit 684f884

Please sign in to comment.