@@ -1233,11 +1233,16 @@ public function configure_courier() {
12331233
12341234 public function configure_dovecot () {
12351235 global $ conf ;
1236-
1236+
12371237 $ virtual_transport = 'dovecot ' ;
12381238
12391239 $ configure_lmtp = false ;
1240-
1240+
1241+ // use lmtp if installed
1242+ if ($ configure_lmtp = is_file ('/usr/lib/dovecot/lmtp ' )) {
1243+ $ virtual_transport = 'lmtp:unix:private/dovecot-lmtp ' ;
1244+ }
1245+
12411246 // check if virtual_transport must be changed
12421247 if ($ this ->is_update ) {
12431248 $ tmp = $ this ->db ->queryOneRecord ("SELECT * FROM ?? WHERE server_id = ? " , $ conf ["mysql " ]["database " ] . ".server " , $ conf ['server_id ' ]);
@@ -1358,20 +1363,20 @@ public function configure_dovecot() {
13581363 }
13591364 }
13601365
1361- //* dovecot-managesieved
1362- if ($ configure_managesieve = is_file ('/usr/lib/dovecot/managesieve ' )) {
1363- //remove #mangesieve+ comment
1364- $ content = file_get_contents ($ config_dir .'/ ' .$ configfile );
1365- $ content = str_replace ('#mangesieve+ ' ,'' ,$ content );
1366- file_put_contents ($ config_dir .'/ ' .$ configfile ,$ content );
1367- unset($ content );
1368- }
1366+ $ dovecot_protocols = 'imap pop3 ' ;
13691367
13701368 //* dovecot-lmtpd
13711369 if ($ configure_lmtp ) {
1372- replaceLine ($ config_dir .'/ ' .$ configfile , 'protocols = imap pop3 ' , 'protocols = imap pop3 lmtp ' , 1 , 0 );
1370+ $ dovecot_protocols .= ' lmtp '
1371+ }
1372+
1373+ //* dovecot-managesieved
1374+ if (is_file ('/usr/lib/dovecot/managesieve ' )) {
1375+ $ dovecot_protocols .= ' sieve '
13731376 }
13741377
1378+ replaceLine ($ config_dir .'/ ' .$ configfile , 'protocols = imap pop3 ' , "protocols = $ dovecot_protocols " , 1 , 0 );
1379+
13751380 //* dovecot-sql.conf
13761381 $ configfile = 'dovecot-sql.conf ' ;
13771382 if (is_file ($ config_dir .'/ ' .$ configfile )) {
0 commit comments