[pmg-devel] [PATCH pmg-api v2 3/3] sync custom spamassassin scores to the slaves
Dominik Csapak
d.csapak at proxmox.com
Thu Nov 14 12:18:54 CET 2019
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 at proxmox.com>
---
src/PMG/Cluster.pm | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/PMG/Cluster.pm b/src/PMG/Cluster.pm
index 0980c68..0486621 100644
--- a/src/PMG/Cluster.pm
+++ b/src/PMG/Cluster.pm
@@ -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');
--
2.20.1
More information about the pmg-devel
mailing list