Skip to content

Commit 2120766

Browse files
committed
use lmtp by default if detected
1 parent f60d97f commit 2120766

File tree

6 files changed

+32
-26
lines changed

6 files changed

+32
-26
lines changed

install/dist/lib/debian60.lib.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ 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;
40-
40+
41+
// use lmtp if installed
42+
if($configure_lmtp = is_file('/usr/lib/dovecot/lmtp')) {
43+
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
44+
}
45+
4146
// check if virtual_transport must be changed
4247
if ($this->is_update) {
4348
$tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']);
@@ -155,20 +160,20 @@ public function configure_dovecot()
155160
}
156161
}
157162

158-
//* dovecot-managesieved
159-
if($configure_managesieve = is_file('/usr/lib/dovecot/managesieve')) {
160-
//remove #mangesieve+ comment
161-
$content = file_get_contents($config_dir.'/'.$configfile);
162-
$content = str_replace('#mangesieve+ ','',$content);
163-
file_put_contents($config_dir.'/'.$configfile,$content);
164-
unset($content);
165-
}
163+
$dovecot_protocols = 'imap pop3';
166164

167165
//* dovecot-lmtpd
168166
if($configure_lmtp) {
169-
replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0);
167+
$dovecot_protocols .= ' lmtp'
168+
}
169+
170+
//* dovecot-managesieved
171+
if(is_file('/usr/lib/dovecot/managesieve')) {
172+
$dovecot_protocols .= ' sieve'
170173
}
171174

175+
replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', "protocols = $dovecot_protocols", 1, 0);
176+
172177
//* dovecot-sql.conf
173178
$configfile = 'dovecot-sql.conf';
174179
if(is_file($config_dir.'/'.$configfile)){

install/lib/installer_base.lib.php

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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)) {

install/tpl/debian6_dovecot2.conf.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,3 @@ namespace inbox {
120120
}
121121
}
122122

123-
#managesieve+ protocols = $protocols sieve

install/tpl/debian_dovecot2.conf.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,3 @@ plugin {
9797
quota_status_overquota = "552 5.2.2 Mailbox is full"
9898
}
9999

100-
#managesieve+ protocols = $protocols sieve

install/tpl/fedora_dovecot2.conf.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,3 @@ namespace inbox {
115115
}
116116
}
117117

118-
#managesieve+ protocols = $protocols sieve

install/tpl/opensuse_dovecot2.conf.master

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,3 @@ namespace inbox {
114114
}
115115
}
116116

117-
#managesieve+ protocols = $protocols sieve

0 commit comments

Comments
 (0)