@@ -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,10 @@ 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+ copy ($ conf ['ispconfig_install_dir ' ].'/server/conf-custom/install/dovecot_custom.conf.master ' , $ config_dir .'/conf.d/99-ispconfig-custom-config.conf ' );
114+ }
111115 replaceLine ($ config_dir .'/ ' .$ configfile , 'postmaster_address = postmaster@example.com ' , 'postmaster_address = postmaster@ ' .$ conf ['hostname ' ], 1 , 0 );
112116 replaceLine ($ config_dir .'/ ' .$ configfile , 'postmaster_address = webmaster@localhost ' , 'postmaster_address = postmaster@ ' .$ conf ['hostname ' ], 1 , 0 );
113117 if (version_compare ($ dovecot_version ,2.1 ) < 0 ) {
@@ -123,7 +127,7 @@ public function configure_dovecot()
123127 if (version_compare ($ dovecot_version ,2.3 ) >= 0 ) {
124128 // Remove deprecated setting(s)
125129 removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_protocols = ' );
126-
130+
127131 // Check if we have a dhparams file and if not, create it
128132 if (!file_exists ('/etc/dovecot/dh.pem ' )) {
129133 swriteln ('Creating new DHParams file, this takes several minutes. Do not interrupt the script. ' );
@@ -146,7 +150,7 @@ public function configure_dovecot()
146150 $ content = str_replace ('#2.3+ ' ,'' ,$ content );
147151 file_put_contents ($ config_dir .'/ ' .$ configfile ,$ content );
148152 unset($ content );
149-
153+
150154 } else {
151155 // remove settings which are not supported in Dovecot < 2.3
152156 removeLine ($ config_dir .'/ ' .$ configfile , 'ssl_min_protocol = ' );
@@ -159,7 +163,7 @@ public function configure_dovecot()
159163 copy ('tpl/debian6_dovecot.conf.master ' , $ config_dir .'/ ' .$ configfile );
160164 }
161165 }
162-
166+
163167 $ dovecot_protocols = 'imap pop3 ' ;
164168
165169 //* dovecot-lmtpd
@@ -196,7 +200,7 @@ public function configure_dovecot()
196200 chmod ($ config_dir .'/ ' .$ configfile , 0600 );
197201 chown ($ config_dir .'/ ' .$ configfile , 'root ' );
198202 chgrp ($ config_dir .'/ ' .$ configfile , 'root ' );
199-
203+
200204 // Dovecot shall ignore mounts in website directory
201205 if (is_installed ('doveadm ' )) exec ("doveadm mount add '/var/www/*' ignore > /dev/null 2> /dev/null " );
202206
0 commit comments