Commit 14150027 authored by Florian Schaal's avatar Florian Schaal

update mail_mail_domain_plugin.inc.php

parent b3ada521
...@@ -122,8 +122,8 @@ class mail_plugin_dkim { ...@@ -122,8 +122,8 @@ class mail_plugin_dkim {
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail'); $mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
if ( isset($mail_config['dkim_path']) && if ( isset($mail_config['dkim_path']) &&
!empty($mail_config['dkim_path']) && !empty($mail_config['dkim_path']) &&
isset($data['new']['dkim_private']) && // isset($data['new']['dkim_private']) &&
!empty($data['new']['dkim_private']) && // !empty($data['new']['dkim_private']) &&
$mail_config['dkim_path'] != '/' $mail_config['dkim_path'] != '/'
) { ) {
if (!is_dir($mail_config['dkim_path'])) { if (!is_dir($mail_config['dkim_path'])) {
...@@ -199,6 +199,10 @@ class mail_plugin_dkim { ...@@ -199,6 +199,10 @@ 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 ($key_file == '' || $key_value == '' || $key_domain == '') {
$app->log('DKIM internal error for domain '.$key_domain, LOGLEVEL_ERROR);
return $success;
}
if ( $app->system->file_put_contents($key_file.'.private', $key_value) ) { 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;
...@@ -211,7 +215,7 @@ class mail_plugin_dkim { ...@@ -211,7 +215,7 @@ class mail_plugin_dkim {
$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 {
$app->log('Unable to save DKIM Privte-key to '.$key_file.'.private', LOGLEVEL_ERROR); $app->log('Unable to save DKIM Private-key to '.$key_file.'.private', LOGLEVEL_ERROR);
} }
return $success; return $success;
} }
......
Markdown is supported
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