]> git.proxmox.com Git - pmg-api.git/commitdiff
reload postfix instead of restart on config change
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 9 Apr 2019 16:13:17 +0000 (18:13 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 12 Apr 2019 07:46:53 +0000 (09:46 +0200)
From `man 1 postfix`:
```
Note: in order to refresh the Postfix mail system after a
configuration change, do not use the start and stop commands in
succession. Use the reload command instead.
```

Additionally restarting postfix, while a mail has been passed to
pmg-smtp-filter but has not beed fed back to postfix again, causes it
to get passed a second time to pmg-smtp-filter (by qmgr) and this
results in duplicate maildelivery

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PMG/API2/MyNetworks.pm
PMG/Config.pm

index 8394096372e11a087d89d77385407ba0f7fc6685..975ca2eb498fc1999a66f83f18931097855e31f3 100644 (file)
@@ -92,7 +92,7 @@ __PACKAGE__->register_method ({
            my $cfg = PMG::Config->new();
 
            if ($cfg->rewrite_config_postfix()) {
-               PMG::Utils::service_cmd('postfix', 'restart');
+               PMG::Utils::service_cmd('postfix', 'reload');
            }
        };
 
@@ -212,7 +212,7 @@ __PACKAGE__->register_method ({
            my $cfg = PMG::Config->new();
 
            if ($cfg->rewrite_config_postfix()) {
-               PMG::Utils::service_cmd('postfix', 'restart');
+               PMG::Utils::service_cmd('postfix', 'reload');
            }
        };
 
index b2e1c6c9a428ae9bcca3cd5cf3e381a5ba14370b..9f1c001e5913630f81a427dcebb08af745cddfb2 100755 (executable)
@@ -1552,7 +1552,7 @@ sub rewrite_config {
 
     if (($self->rewrite_config_postfix($rulecache) && $restart_services) ||
        $force_restart->{postfix}) {
-       PMG::Utils::service_cmd('postfix', 'restart');
+       PMG::Utils::service_cmd('postfix', 'reload');
     }
 
     if ($self->rewrite_dot_forward() && $restart_services) {