Commit 1f44b67e authored by tbrehm's avatar tbrehm
Browse files

Fixed: FS#2043 - SASL configuration mistake

Fixed: PHP notices in jailkit user plugin.
parent 9c513ce8
......@@ -750,9 +750,22 @@ class installer_base {
public function configure_saslauthd() {
global $conf;
//* Get saslsauthd version
exec('saslauthd -v 2>&1',$out);
$parts = explode(' ',$out[0]);
$saslversion = $parts[1];
unset($parts);
unset($out);
$configfile = 'sasl_smtpd.conf';
if(version_compare($saslversion , '2.1.23') > 0) {
//* Configfile for saslauthd versions 2.1.24 and newer
$configfile = 'sasl_smtpd2.conf';
} else {
//* Configfile for saslauthd versions up to 2.1.23
$configfile = 'sasl_smtpd.conf';
}
if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf')) copy($conf['postfix']['config_dir'].'/sasl/smtpd.conf',$conf['postfix']['config_dir'].'/sasl/smtpd.conf~');
if(is_file($conf['postfix']['config_dir'].'/sasl/smtpd.conf~')) chmod($conf['postfix']['config_dir'].'/sasl/smtpd.conf~', 0400);
$content = rf('tpl/'.$configfile.'.master');
......
pwcheck_method: saslauthd
mech_list: plain login
allow_plaintext: true
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: {mysql_server_ip}
sql_user: {mysql_server_ispconfig_user}
sql_passwd: {mysql_server_ispconfig_password}
sql_database: {mysql_server_database}
sql_select: select password from mail_user where login = '%u@%r' and postfix = 'y'
......@@ -376,9 +376,9 @@ class shelluser_jailkit_plugin {
if(is_file('/root/.ssh/authorized_keys')) file_put_contents($sshkeys, file_get_contents('/root/.ssh/authorized_keys'));
// Remove duplicate keys
$existing_keys = file($sshkeys);
$existing_keys = @file($sshkeys);
$new_keys = explode("\n", $userkey);
$final_keys_arr = array_merge($existing_keys, $new_keys);
$final_keys_arr = @array_merge($existing_keys, $new_keys);
$new_final_keys_arr = array();
if(is_array($final_keys_arr) && !empty($final_keys_arr)){
foreach($final_keys_arr as $key => $val){
......
Supports Markdown
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