tbrehm
2012-06-06 1f44b67ec6586e328b98781722f30db198b84734
Fixed: FS#2043 - SASL configuration mistake
Fixed: PHP notices in jailkit user plugin.
1 files added
2 files modified
31 ■■■■ changed files
install/lib/installer_base.lib.php 17 ●●●● patch | view | raw | blame | history
install/tpl/sasl_smtpd2.conf.master 10 ●●●●● patch | view | raw | blame | history
server/plugins-available/shelluser_jailkit_plugin.inc.php 4 ●●●● patch | view | raw | blame | history
install/lib/installer_base.lib.php
@@ -750,9 +750,22 @@
    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');
install/tpl/sasl_smtpd2.conf.master
New file
@@ -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'
server/plugins-available/shelluser_jailkit_plugin.inc.php
@@ -376,9 +376,9 @@
            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){