Marius Cramer
2015-11-15 85fdab1f3538495979abfceedb44dcf5e5002e2a
Merge branch 'master' into 'master'

Master



See merge request !243
1 files modified
39 ■■■■ changed files
server/plugins-available/postfix_server_plugin.inc.php 39 ●●●● patch | view | raw | blame | history
server/plugins-available/postfix_server_plugin.inc.php
@@ -161,27 +161,30 @@
            exec('postfix reload');
        }        
        
        if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') {
            // If dovecot switch to lmtp
            if($app->system->is_installed('dovecot')) {
                exec("postconf -e 'virtual_transport = lmtp:unix:private/dovecot-lmtp'");
                exec('postfix reload');
                $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3", "protocols = imap pop3 lmtp");
                exec($conf['init_scripts'] . '/' . 'dovecot restart');
            }
        }
        else {
            // If dovecot switch to dovecot
            if($app->system->is_installed('dovecot')) {
                exec("postconf -e 'virtual_transport = dovecot'");
                exec('postfix reload');
                $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3 lmtp", "protocols = imap pop3");
                exec($conf['init_scripts'] . '/' . 'dovecot restart');
        if($app->system->is_installed('dovecot')) {
            $temp = exec("postconf -n virtual_transport", $out);
            if ($mail_config["mailbox_virtual_uidgid_maps"] == 'y') {
                // If dovecot switch to lmtp
                if($out[0] != "virtual_transport = lmtp:unix:private/dovecot-lmtp") {
                    exec("postconf -e 'virtual_transport = lmtp:unix:private/dovecot-lmtp'");
                    exec('postfix reload');
                    $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3", "protocols = imap pop3 lmtp");
                    exec($conf['init_scripts'] . '/' . 'dovecot restart');
                }
            } else {
                // If dovecot switch to dovecot
                if($out[0] != "virtual_transport = dovecot") {
                    exec("postconf -e 'virtual_transport = dovecot'");
                    exec('postfix reload');
                    $app->system->replaceLine("/etc/dovecot/dovecot.conf", "protocols = imap pop3 lmtp", "protocols = imap pop3");
                    exec($conf['init_scripts'] . '/' . 'dovecot restart');
                }
            }
        }
        exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'");
        exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'");
        exec("postconf -e 'mailbox_size_limit = ".intval($mail_config['mailbox_size_limit']*1024*1024)."'"); //TODO : no reload?
        exec("postconf -e 'message_size_limit = ".intval($mail_config['message_size_limit']*1024*1024)."'"); //TODO : no reload?
    }