Skip to content

Commit c9fa7a4

Browse files
author
Florian Schaal
committed
changed some logics
1 parent 02ff268 commit c9fa7a4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function check_system($data) {
152152
}
153153

154154
} else {
155-
$app->log('Unable to write DKIM settings - no DKIM-Path defined', LOGLEVEL_ERROR);
155+
$app->log('Unable to write DKIM settings - no or invalid DKIM-Path defined', LOGLEVEL_ERROR);
156156
$check=false;
157157
}
158158
return $check;
@@ -174,6 +174,7 @@ function restart_amavis() {
174174
break;
175175
}
176176
}
177+
if ( $initfile == '' ) $initfile = 'service amavis';
177178
$app->log('Restarting amavis: '.$initfile.'.', LOGLEVEL_DEBUG);
178179
exec(escapeshellarg($initfile).' restart', $output);
179180
foreach($output as $logline) $app->log($logline, LOGLEVEL_DEBUG);
@@ -189,15 +190,15 @@ function restart_amavis() {
189190
function write_dkim_key($key_file, $key_value, $key_domain) {
190191
global $app, $mailconfig;
191192
$success=false;
192-
if (!$app->system->file_put_contents($key_file.'.private', $key_value) === false) {
193+
if ( $app->system->file_put_contents($key_file.'.private', $key_value) ) {
193194
$app->log('Saved DKIM Private-key to '.$key_file.'.private', LOGLEVEL_DEBUG);
194195
$success=true;
195196
/* now we get the DKIM Public-key */
196197
exec('cat '.escapeshellarg($key_file.'.private').'|openssl rsa -pubout 2> /dev/null', $pubkey, $result);
197198
$public_key='';
198199
foreach($pubkey as $values) $public_key=$public_key.$values."\n";
199200
/* save the DKIM Public-key in dkim-dir */
200-
if (!$app->system->file_put_contents($key_file.'.public', $public_key) === false)
201+
if ( $app->system->file_put_contents($key_file.'.public', $public_key) )
201202
$app->log('Saved DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
202203
else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
203204
} else {

0 commit comments

Comments
 (0)