summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-09-30 13:58:12 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-09-30 13:58:12 +0200
commitdc474d27e054cc9879750cef25edacd01c5315a6 (patch)
tree3d8f474931de4882dfb297240843534eccaf6041 /pykolab
parent9d70f9d837c50e0b74b69d7e8b69c93294dd767a (diff)
downloadpykolab-dc474d27e054cc9879750cef25edacd01c5315a6.tar.gz
Add configuring freshclam
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_mta.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/pykolab/setup/setup_mta.py b/pykolab/setup/setup_mta.py
index 87039e5..53293cf 100644
--- a/pykolab/setup/setup_mta.py
+++ b/pykolab/setup/setup_mta.py
@@ -456,6 +456,28 @@ result_format = "shared+%%s"
with open('/etc/systemd/system/clamd@.service', 'wb') as f:
unitfile.write(f)
+ log.info(_("Configuring and refreshing Anti-Virus..."))
+
+ if os.path.isfile('/etc/kolab/templates/freshclam.conf.tpl'):
+ shutil.copy(
+ '/etc/kolab/templates/freshclam.conf.tpl',
+ '/etc/freshclam.conf'
+ )
+ elif os.path.isfile('/usr/share/kolab/templates/freshclam.conf.tpl'):
+ shutil.copy(
+ '/usr/share/kolab/templates/freshclam.conf.tpl',
+ '/etc/freshclam.conf'
+ )
+ else:
+ log.error(_("Could not find a ClamAV update configuration file"))
+
+ if os.path.isfile('/etc/freshclam.conf'):
+ subprocess.call(
+ '/usr/bin/freshclam',
+ '--quiet',
+ '--datadir="/var/lib/clamav"'
+ )
+
amavisservice = 'amavisd.service'
clamavservice = 'clamd@amavisd.service'
if os.path.isfile('/usr/lib/systemd/system/amavis.service'):