Skip to content

Commit 03200f1

Browse files
author
Florian Schaal
committed
add amavis-configfile-location for centos 6.4; add amavis-initscrip-name for centos 6.4; fixed missing private_key in mail/mail_domain_dkim_create.php
1 parent d24bb48 commit 03200f1

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

interface/web/mail/mail_domain_dkim_create.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function get_public_key($private_key) {
9595
exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096', $output, $result);
9696
exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024', $privkey, $result);
9797
unlink("/usr/local/ispconfig/server/temp/random-data.bin");
98-
$private_key='';
98+
foreach($privkey as $values) $private_key=$private_key.$values."\n";
9999
break;
100100

101101
case 'show': /* show the DNS-Record onLoad */

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ function get_amavis_config() {
7777
$pos_config=array(
7878
'/etc/amavisd.conf',
7979
'/etc/amavisd.conf/50-user',
80-
'/etc/amavis/conf.d/50-user'
80+
'/etc/amavis/conf.d/50-user',
81+
'/etc/amavisd/amavisd.conf'
8182
);
8283
$amavis_configfile='';
8384
foreach($pos_config as $conf) {
@@ -123,13 +124,22 @@ function check_system($data) {
123124
*/
124125
function restart_amavis() {
125126
global $app, $conf;
126-
$initfile=$conf['init_scripts'].'/amavis';
127-
$app->log('Restarting amavis.', LOGLEVEL_DEBUG);
128-
exec(escapeshellarg($conf['init_scripts']).escapeshellarg('/amavis').' restart', $output);
127+
$pos_init=array(
128+
$conf['init_scripts'].'/amavis',
129+
$conf['init_scripts'].'/amavisd'
130+
);
131+
$initfile='';
132+
foreach($pos_init as $init) {
133+
if (is_executable($init)) {
134+
$initfile=$init;
135+
break;
136+
}
137+
}
138+
$app->log('Restarting amavis: '.$initfile.'.', LOGLEVEL_DEBUG);
139+
exec(escapeshellarg($initfile).' restart', $output);
129140
foreach($output as $logline) $app->log($logline, LOGLEVEL_DEBUG);
130141
}
131142

132-
133143
/**
134144
* This function writes the keyfiles (public and private)
135145
* @param string $key_file full path to the key-file

0 commit comments

Comments
 (0)