From e2b4f760bb91caf66445a888c7a185e972e97a3c Mon Sep 17 00:00:00 2001
From: Marius Cramer <m.cramer@pixcept.de>
Date: Tue, 11 Feb 2014 04:45:44 -0500
Subject: [PATCH] Merge branch 'master' into 'master'
---
server/plugins-available/mail_plugin_dkim.inc.php | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/server/plugins-available/mail_plugin_dkim.inc.php b/server/plugins-available/mail_plugin_dkim.inc.php
index 325dc0b..72d9f45 100644
--- a/server/plugins-available/mail_plugin_dkim.inc.php
+++ b/server/plugins-available/mail_plugin_dkim.inc.php
@@ -107,11 +107,18 @@
}
/* dir for dkim-keys writeable? */
$mail_config = $app->getconf->get_server_config($conf['server_id'], 'mail');
- if (isset($mail_config['dkim_path']) && isset($data['new']['dkim_private']) && !empty($data['new']['dkim_private'])) {
+ if (isset($mail_config['dkim_path']) && (!empty($mail_config['dkim_path'])) && isset($data['new']['dkim_private']) && !empty($data['new']['dkim_private'])) {
+
+ if (!is_dir($mail_config['dkim_path'])) {
+ $app->log('DKIM Path '.$mail_config['dkim_path'].' not found - (re)created.', LOGLEVEL_DEBUG);
+ mkdir($mail_config['dkim_path'], 0750, true);
+ }
+
if (!is_writeable($mail_config['dkim_path'])) {
- $app->log('DKIM Path '.$mail_config['dkim_path'].' not found or not writeable.', LOGLEVEL_ERROR);
+ $app->log('DKIM Path '.$mail_config['dkim_path'].' not writeable.', LOGLEVEL_ERROR);
$check=false;
}
+
} else {
$app->log('Unable to write DKIM settings; Check your config!', LOGLEVEL_ERROR);
$check=false;
@@ -160,7 +167,7 @@
/* save the DKIM Public-key in dkim-dir */
if (!file_put_contents($key_file.'.public', $public_key) === false)
$app->log('Saved DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
- else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_WARNING);
+ else $app->log('Unable to save DKIM Public to '.$key_domain.'.', LOGLEVEL_DEBUG);
}
return $success;
}
@@ -220,7 +227,7 @@
file_put_contents($this->get_amavis_config(), $amavis_config);
$app->log('Deleted the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_DEBUG);
$this->restart_amavis();
- } else $app->log('Unable to delete the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_ERROR);
+ } else $app->log('Unable to delete the DKIM settings from amavis-config for '.$key_domain.'.', LOGLEVEL_DEBUG);
}
/**
--
Gitblit v1.9.1