From 226c9a862a6e46ff851626d7a6cdafbfcbc9b8f4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 1 Feb 2017 16:19:37 +0100 Subject: [PATCH] read Dovecot master-user from UCS configuration --- doc/rpm-build/post_install.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/rpm-build/post_install.php b/doc/rpm-build/post_install.php index f27dcf321e..f287fe308b 100755 --- a/doc/rpm-build/post_install.php +++ b/doc/rpm-build/post_install.php @@ -672,7 +672,16 @@ function set_univention_defaults() $config['mailserver'] = "$mailserver,993,$domain,email,tls"; if (_ucr_get('mail/dovecot') == 'yes') { - $config['imap'] = /*'cyrus,'._ucr_secret('cyrus')*/','.',Imap\\Dovecot'; + $matches = null; + if (file_exists('/etc/dovecot/master-users') && + preg_match('/^([^:]+):{PLAIN}([^:]+):/i', file_get_contents('/etc/dovecot/master-users'), $matches)) + { + $config['imap'] = $matches[1].','.$matches[2].',Imap\\Dovecot'; + } + else + { + $config['imap'] = ',,Imap\\Dovecot'; + } // default with sieve port to 4190, as config is only available on host mailserver app is installed if (!($sieve_port = _ucr_get('mail/dovecot/sieve/port'))) $sieve_port = 4190; }