]> git.proxmox.com Git - pmg-api.git/commitdiff
sync custom spamassassin scores to the slaves
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 14 Nov 2019 11:18:54 +0000 (12:18 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 15 Nov 2019 08:51:40 +0000 (09:51 +0100)
and set force_restart for pmg-smtp-filter to 1, so that it gets
restarted on the slaves as well

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PMG/Cluster.pm

index 0980c68a8beb9173b709bf931528d7303204419e..048662148e743ce32bcb89f6a615d35a742e8f9b 100644 (file)
@@ -349,10 +349,11 @@ sub sync_config_from_master {
 
     my $sa_conf_dir = "/etc/mail/spamassassin";
     my $sa_custom_cf = "custom.cf";
+    my $sa_rules_cf = "pmg-scores.cf";
 
     my $cmd = $rsync_command->(
        $master_name, '-aq',
-       "[${master_ip}]:$cfgdir/* ${sa_conf_dir}/${sa_custom_cf}",
+       "[${master_ip}]:$cfgdir/* ${sa_conf_dir}/${sa_custom_cf} ${sa_conf_dir}/${sa_rules_cf}",
        "$syncdir/",
        '--exclude', 'master/',
        '--exclude', '*~',
@@ -421,8 +422,10 @@ sub sync_config_from_master {
 
     my $force_restart = {};
 
-    if ($cond_commit_synced_file->($sa_custom_cf, "${sa_conf_dir}/${sa_custom_cf}")) {
-       $force_restart->{'pmg-smtp-filter'} = 1;
+    for my $file (($sa_custom_cf, $sa_rules_cf)) {
+       if ($cond_commit_synced_file->($file, "${sa_conf_dir}/${file}")) {
+           $force_restart->{'pmg-smtp-filter'} = 1;
+       }
     }
 
     $cond_commit_synced_file->('pmg.conf');