diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 832d5b7952799240a3e76ffc519586c3c514424b..fc264ec03a81e172f4bab11ba8d97fb7479ec11a 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -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'); diff --git a/install/tpl/sasl_smtpd2.conf.master b/install/tpl/sasl_smtpd2.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..f24b998d883dbe4054336e0c1cd4bdceef354efc --- /dev/null +++ b/install/tpl/sasl_smtpd2.conf.master @@ -0,0 +1,10 @@ +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' diff --git a/server/plugins-available/shelluser_jailkit_plugin.inc.php b/server/plugins-available/shelluser_jailkit_plugin.inc.php index 86e92f613d19f02f6720d2928b802925f56cb6bb..671ae62c16df0cb9e165a47744d89d63ae9fcae8 100755 --- a/server/plugins-available/shelluser_jailkit_plugin.inc.php +++ b/server/plugins-available/shelluser_jailkit_plugin.inc.php @@ -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){