From: Dominik Csapak Date: Wed, 25 Oct 2017 12:27:51 +0000 (+0200) Subject: update spamassassin rules daily X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=7122424bb5e33af3981f1e87e38764c91029e2c8;p=pmg-api.git update spamassassin rules daily after the update, restart the pmg-smtp-filter Signed-off-by: Dominik Csapak --- diff --git a/bin/pmg-daily b/bin/pmg-daily index 985e7d0..ebb78f2 100755 --- a/bin/pmg-daily +++ b/bin/pmg-daily @@ -50,6 +50,13 @@ if (my $statlifetime = $cfg->get ('admin', 'statlifetime')) { # rotate razor log file rename('/root/.razor/razor-agent.log', '/root/.razor/razor-agent.log.0'); +# update spamassassin rules +if (system('sa-update') == 0) { + # if the exit code is 0, new updates were downloaded + # then restart the pmg-smtp-filter to load the new rules + PMG::Utils::service_cmd('pmg-smtp-filter', 'restart'); +} + # run bayes database maintainance system('sa-learn --force-expire >/dev/null 2>&1');