Skip to content

Commit 3f6ee66

Browse files
author
Marius Cramer
committed
Merge branch 'master' into 'master'
Master See merge request !115
2 parents 596a609 + d5712ba commit 3f6ee66

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

docs/Remote_API_docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

22

3-
The remote API documentation is in the remote_client/API-docs subfolder.
3+
The remote API documentation is in the remoting_client/API-docs subfolder.

interface/web/mail/mail_domain_dkim_create.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function get_public_key($private_key) {
8080
require_once('../../lib/classes/validate_dkim.inc.php');
8181
$validate_dkim=new validate_dkim ();
8282
if($validate_dkim->validate_post('private',$private_key)) { /* validate the $_POST-value */
83-
exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM',$pubkey,$result);
83+
exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM 2> /dev/null',$pubkey,$result);
8484
$public_key=pub_key($pubkey);
8585
} else {
8686
$public_key='invalid key';
@@ -92,8 +92,8 @@ function get_public_key($private_key) {
9292

9393
switch ($_POST['action']) {
9494
case 'create': /* create DKIM Private-key */
95-
exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096', $output, $result);
96-
exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024', $privkey, $result);
95+
exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096 2> /dev/null', $output, $result);
96+
exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024 2> /dev/null', $privkey, $result);
9797
unlink("/usr/local/ispconfig/server/temp/random-data.bin");
9898
foreach($privkey as $values) $private_key=$private_key.$values."\n";
9999
break;

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,21 @@ function check_system($data) {
123123

124124
if (!is_dir($mail_config['dkim_path'])) {
125125
$app->log('DKIM Path '.$mail_config['dkim_path'].' not found - (re)created.', LOGLEVEL_DEBUG);
126-
mkdir($mail_config['dkim_path'], 0750, true);
126+
if($app->system->is_user('amavis')) {
127+
$amavis_user='amavis';
128+
} elseif ($app->system->is_user('vscan')) {
129+
$amavis_user='vscan';
130+
}
131+
else {
132+
$amavis_user='';
133+
}
134+
if(!empty($amavis_user)) {
135+
mkdir($mail_config['dkim_path'], 0750, true);
136+
exec('chown '.$amavis_user.' /var/lib/amavis/dkim');
137+
unset($amavis_user);
138+
} else {
139+
mkdir($mail_config['dkim_path'], 0755, true);
140+
}
127141
}
128142

129143
if (!is_writeable($mail_config['dkim_path'])) {
@@ -173,7 +187,7 @@ function write_dkim_key($key_file, $key_value, $key_domain) {
173187
$app->log('Saved DKIM Private-key to '.$key_file.'.private', LOGLEVEL_DEBUG);
174188
$success=true;
175189
/* now we get the DKIM Public-key */
176-
exec('cat '.escapeshellarg($key_file.'.private').'|openssl rsa -pubout', $pubkey, $result);
190+
exec('cat '.escapeshellarg($key_file.'.private').'|openssl rsa -pubout 2> /dev/null', $pubkey, $result);
177191
$public_key='';
178192
foreach($pubkey as $values) $public_key=$public_key.$values."\n";
179193
/* save the DKIM Public-key in dkim-dir */

0 commit comments

Comments
 (0)