X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=src%2FPMG%2FAPI2%2FCertificates.pm;h=1a7ded68294ebba3508ceec22f4a28a15100e7d1;hb=1ecf138e1729dee908431673b73ac5baf8fd35a9;hp=1a6c434206ffb8bc8b33d6dcd953762b7c1910de;hpb=58f5c8f1121ee116fa81922fead0cfeca272b6c7;p=pmg-api.git diff --git a/src/PMG/API2/Certificates.pm b/src/PMG/API2/Certificates.pm index 1a6c434..1a7ded6 100644 --- a/src/PMG/API2/Certificates.pm +++ b/src/PMG/API2/Certificates.pm @@ -69,16 +69,14 @@ my sub set_smtp : prototype($$) { my $code = sub { my $cfg = PMG::Config->new(); - if (!$cfg->get('mail', 'tls') == !$on) { - return; + if (!$cfg->get('mail', 'tls') != !$on) { + print "Rewriting postfix config\n"; + $cfg->set('mail', 'tls', $on); + $cfg->write(); + my $changed = $cfg->rewrite_config_postfix(); } - print "Rewriting postfix config\n"; - $cfg->set('mail', 'tls', $on); - $cfg->write(); - my $changed = $cfg->rewrite_config_postfix(); - - if ($changed && $reload) { + if ($reload) { print "Reloading postfix\n"; PMG::Utils::service_cmd('postfix', 'reload'); }