Skip to content

Commit 706fdd3

Browse files
author
Marius Burkard
committed
Merge branch '6096-dovecot-conf-not-copied' into 'develop'
Resolve "Dovecot not copied from conf-custom to dovecot/conf.d" Closes #6096 See merge request ispconfig/ispconfig3!1441
2 parents c40198b + eed63b3 commit 706fdd3

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

install/dist/lib/debian60.lib.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

install/lib/installer_base.lib.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,9 @@ public function configure_dovecot() {
15361536
}
15371537
// Copy custom config file
15381538
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/dovecot_custom.conf.master')) {
1539+
if(!@is_dir($config_dir . '/conf.d')) {
1540+
mkdir($config_dir . '/conf.d');
1541+
}
15391542
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/dovecot_custom.conf.master', $config_dir.'/conf.d/99-ispconfig-custom-config.conf');
15401543
}
15411544
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);

install/tpl/debian6_dovecot2.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protocol lmtp {
9191
#2.3+ group = vmail
9292
#2.3+ mode = 0660
9393
#2.3+ }
94-
#2.3+
94+
#2.3+
9595
#2.3+ unix_listener stats-writer {
9696
#2.3+ user = vmail
9797
#2.3+ group = vmail

0 commit comments

Comments
 (0)