Commit c9fa7a41 authored by Florian Schaal's avatar Florian Schaal
Browse files

changed some logics

parent 02ff2682
...@@ -152,7 +152,7 @@ class mail_plugin_dkim { ...@@ -152,7 +152,7 @@ class mail_plugin_dkim {
} }
} else { } else {
$app->log('Unable to write DKIM settings - no DKIM-Path defined', LOGLEVEL_ERROR); $app->log('Unable to write DKIM settings - no or invalid DKIM-Path defined', LOGLEVEL_ERROR);
$check=false; $check=false;
} }
return $check; return $check;
...@@ -174,6 +174,7 @@ class mail_plugin_dkim { ...@@ -174,6 +174,7 @@ class mail_plugin_dkim {
break; break;
} }
} }
if ( $initfile == '' ) $initfile = 'service amavis';
$app->log('Restarting amavis: '.$initfile.'.', LOGLEVEL_DEBUG); $app->log('Restarting amavis: '.$initfile.'.', LOGLEVEL_DEBUG);
exec(escapeshellarg($initfile).' restart', $output); exec(escapeshellarg($initfile).' restart', $output);
foreach($output as $logline) $app->log($logline, LOGLEVEL_DEBUG); foreach($output as $logline) $app->log($logline, LOGLEVEL_DEBUG);
...@@ -189,7 +190,7 @@ class mail_plugin_dkim { ...@@ -189,7 +190,7 @@ class mail_plugin_dkim {
function write_dkim_key($key_file, $key_value, $key_domain) { function write_dkim_key($key_file, $key_value, $key_domain) {
global $app, $mailconfig; global $app, $mailconfig;
$success=false; $success=false;
if (!$app->system->file_put_contents($key_file.'.private', $key_value) === false) { if ( $app->system->file_put_contents($key_file.'.private', $key_value) ) {
$app->log('Saved DKIM Private-key to '.$key_file.'.private', LOGLEVEL_DEBUG); $app->log('Saved DKIM Private-key to '.$key_file.'.private', LOGLEVEL_DEBUG);
$success=true; $success=true;
/* now we get the DKIM Public-key */ /* now we get the DKIM Public-key */
...@@ -197,7 +198,7 @@ class mail_plugin_dkim { ...@@ -197,7 +198,7 @@ class mail_plugin_dkim {
$public_key=''; $public_key='';
foreach($pubkey as $values) $public_key=$public_key.$values."\n"; foreach($pubkey as $values) $public_key=$public_key.$values."\n";
/* save the DKIM Public-key in dkim-dir */ /* save the DKIM Public-key in dkim-dir */
if (!$app->system->file_put_contents($key_file.'.public', $public_key) === false) if ( $app->system->file_put_contents($key_file.'.public', $public_key) )
$app->log('Saved DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG); $app->log('Saved DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG); else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
} else { } else {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment