@@ -33,7 +33,7 @@ class installer extends installer_base {
3333 public function configure_dovecot ()
3434 {
3535 global $ conf ;
36-
36+
3737 $ virtual_transport = 'dovecot ' ;
3838
3939 $ configure_lmtp = false ;
@@ -48,7 +48,7 @@ public function configure_dovecot()
4848 $ tmp = $ this ->db ->queryOneRecord ("SELECT * FROM ?? WHERE server_id = ? " , $ conf ["mysql " ]["database " ] . ".server " , $ conf ['server_id ' ]);
4949 $ ini_array = ini_to_array (stripslashes ($ tmp ['config ' ]));
5050 // ini_array needs not to be checked, because already done in update.php -> updateDbAndIni()
51-
51+
5252 if (isset ($ ini_array ['mail ' ]['mailbox_virtual_uidgid_maps ' ]) && $ ini_array ['mail ' ]['mailbox_virtual_uidgid_maps ' ] == 'y ' ) {
5353 $ virtual_transport = 'lmtp:unix:private/dovecot-lmtp ' ;
5454 $ configure_lmtp = true ;
@@ -108,6 +108,13 @@ public function configure_dovecot()
108108 } else {
109109 copy ('tpl/debian6_dovecot2.conf.master ' , $ config_dir .'/ ' .$ configfile );
110110 }
111+ // Copy custom config file
112+ if (is_file ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/dovecot_custom.conf.master ' )) {
113+ if (!@is_dir ($ config_dir . '/conf.d ' )) {
114+ mkdir ($ config_dir . '/conf.d ' );
115+ }
116+ copy ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/dovecot_custom.conf.master ' , $ config_dir .'/conf.d/99-ispconfig-custom-config.conf ' );
117+ }
111118 replaceLine ($ config_dir .'/ ' .$ configfile , 'postmaster_address = postmaster@example.com ' , 'postmaster_address = postmaster@ ' .$ conf ['hostname ' ], 1 , 0 );
112119 replaceLine ($ config_dir .'/ ' .$ configfile , 'postmaster_address = webmaster@localhost ' , 'postmaster_address = postmaster@ ' .$ conf ['hostname ' ], 1 , 0 );
113120 if (version_compare ($ dovecot_version ,2.1 ) < 0 ) {
@@ -123,7 +130,7 @@ public function configure_dovecot()
123130 if (version_compare ($ dovecot_version ,2.3 ) >= 0 ) {
124131 // Remove deprecated setting(s)
125132 removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_protocols = ' );
126-
133+
127134 // Check if we have a dhparams file and if not, create it
128135 if (!file_exists ('/etc/dovecot/dh.pem ' )) {
129136 swriteln ('Creating new DHParams file, this takes several minutes. Do not interrupt the script. ' );
@@ -146,7 +153,7 @@ public function configure_dovecot()
146153 $ content = str_replace ('#2.3+ ' ,'' ,$ content );
147154 file_put_contents ($ config_dir .'/ ' .$ configfile ,$ content );
148155 unset($ content );
149-
156+
150157 } else {
151158 // remove settings which are not supported in Dovecot < 2.3
152159 removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_min_protocol = ' );
@@ -159,7 +166,7 @@ public function configure_dovecot()
159166 copy ('tpl/debian6_dovecot.conf.master ' , $ config_dir .'/ ' .$ configfile );
160167 }
161168 }
162-
169+
163170 $ dovecot_protocols = 'imap pop3 ' ;
164171
165172 //* dovecot-lmtpd
@@ -196,7 +203,7 @@ public function configure_dovecot()
196203 chmod ($ config_dir .'/ ' .$ configfile , 0600 );
197204 chown ($ config_dir .'/ ' .$ configfile , 'root ' );
198205 chgrp ($ config_dir .'/ ' .$ configfile , 'root ' );
199-
206+
200207 // Dovecot shall ignore mounts in website directory
201208 if (is_installed ('doveadm ' )) exec ("doveadm mount add '/var/www/*' ignore > /dev/null 2> /dev/null " );
202209
0 commit comments