Skip to content
Snippets Groups Projects
Commit 2120766a authored by Jesse Norell's avatar Jesse Norell
Browse files

use lmtp by default if detected

parent f60d97f4
No related branches found
No related tags found
No related merge requests found
...@@ -33,11 +33,16 @@ class installer extends installer_base { ...@@ -33,11 +33,16 @@ class installer extends installer_base {
public function configure_dovecot() public function configure_dovecot()
{ {
global $conf; global $conf;
$virtual_transport = 'dovecot'; $virtual_transport = 'dovecot';
$configure_lmtp = false; $configure_lmtp = false;
// use lmtp if installed
if($configure_lmtp = is_file('/usr/lib/dovecot/lmtp')) {
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
}
// check if virtual_transport must be changed // check if virtual_transport must be changed
if ($this->is_update) { if ($this->is_update) {
$tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']);
...@@ -155,20 +160,20 @@ class installer extends installer_base { ...@@ -155,20 +160,20 @@ class installer extends installer_base {
} }
} }
//* dovecot-managesieved $dovecot_protocols = 'imap pop3';
if($configure_managesieve = is_file('/usr/lib/dovecot/managesieve')) {
//remove #mangesieve+ comment
$content = file_get_contents($config_dir.'/'.$configfile);
$content = str_replace('#mangesieve+ ','',$content);
file_put_contents($config_dir.'/'.$configfile,$content);
unset($content);
}
//* dovecot-lmtpd //* dovecot-lmtpd
if($configure_lmtp) { if($configure_lmtp) {
replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0); $dovecot_protocols .= ' lmtp'
}
//* dovecot-managesieved
if(is_file('/usr/lib/dovecot/managesieve')) {
$dovecot_protocols .= ' sieve'
} }
replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', "protocols = $dovecot_protocols", 1, 0);
//* dovecot-sql.conf //* dovecot-sql.conf
$configfile = 'dovecot-sql.conf'; $configfile = 'dovecot-sql.conf';
if(is_file($config_dir.'/'.$configfile)){ if(is_file($config_dir.'/'.$configfile)){
......
...@@ -1233,11 +1233,16 @@ class installer_base { ...@@ -1233,11 +1233,16 @@ class installer_base {
public function configure_dovecot() { public function configure_dovecot() {
global $conf; global $conf;
$virtual_transport = 'dovecot'; $virtual_transport = 'dovecot';
$configure_lmtp = false; $configure_lmtp = false;
// use lmtp if installed
if($configure_lmtp = is_file('/usr/lib/dovecot/lmtp')) {
$virtual_transport = 'lmtp:unix:private/dovecot-lmtp';
}
// check if virtual_transport must be changed // check if virtual_transport must be changed
if ($this->is_update) { if ($this->is_update) {
$tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']); $tmp = $this->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . ".server", $conf['server_id']);
...@@ -1358,20 +1363,20 @@ class installer_base { ...@@ -1358,20 +1363,20 @@ class installer_base {
} }
} }
//* dovecot-managesieved $dovecot_protocols = 'imap pop3';
if($configure_managesieve = is_file('/usr/lib/dovecot/managesieve')) {
//remove #mangesieve+ comment
$content = file_get_contents($config_dir.'/'.$configfile);
$content = str_replace('#mangesieve+ ','',$content);
file_put_contents($config_dir.'/'.$configfile,$content);
unset($content);
}
//* dovecot-lmtpd //* dovecot-lmtpd
if($configure_lmtp) { if($configure_lmtp) {
replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', 'protocols = imap pop3 lmtp', 1, 0); $dovecot_protocols .= ' lmtp'
}
//* dovecot-managesieved
if(is_file('/usr/lib/dovecot/managesieve')) {
$dovecot_protocols .= ' sieve'
} }
replaceLine($config_dir.'/'.$configfile, 'protocols = imap pop3', "protocols = $dovecot_protocols", 1, 0);
//* dovecot-sql.conf //* dovecot-sql.conf
$configfile = 'dovecot-sql.conf'; $configfile = 'dovecot-sql.conf';
if(is_file($config_dir.'/'.$configfile)) { if(is_file($config_dir.'/'.$configfile)) {
......
...@@ -120,4 +120,3 @@ namespace inbox { ...@@ -120,4 +120,3 @@ namespace inbox {
} }
} }
#managesieve+ protocols = $protocols sieve
...@@ -97,4 +97,3 @@ plugin { ...@@ -97,4 +97,3 @@ plugin {
quota_status_overquota = "552 5.2.2 Mailbox is full" quota_status_overquota = "552 5.2.2 Mailbox is full"
} }
#managesieve+ protocols = $protocols sieve
...@@ -115,4 +115,3 @@ namespace inbox { ...@@ -115,4 +115,3 @@ namespace inbox {
} }
} }
#managesieve+ protocols = $protocols sieve
...@@ -114,4 +114,3 @@ namespace inbox { ...@@ -114,4 +114,3 @@ namespace inbox {
} }
} }
#managesieve+ protocols = $protocols sieve
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment