Commit 3118c93b authored by Marius Burkard's avatar Marius Burkard
Browse files

Merge branch '5988-custom-config-postfix-dovecot' into 'develop'

Add new function for custom config usage for Postfix and Dovecot (#5988)

Closes #5988

See merge request ispconfig/ispconfig3!1405
parents 1d8d8e3d e753de51
......@@ -1182,6 +1182,12 @@ class installer_base {
$content = strtr($content, $postconf_placeholders);
$postconf_commands = array_merge($postconf_commands, array_filter(explode("\n", $content)));
}
$configfile = 'postfix_custom.conf';
if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/' . $configfile . '.master')) {
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master');
$content = strtr($content, $postconf_placeholders);
$postconf_commands = array_merge($postconf_commands, array_filter(explode("\n", $content)));
}
// Remove comment lines, these would give fatal errors when passed to postconf.
$postconf_commands = array_filter($postconf_commands, function($line) { return preg_match('/^[^#]/', $line); });
......@@ -1535,6 +1541,10 @@ class installer_base {
} else {
copy('tpl/debian_dovecot2.conf.master', $config_dir.'/'.$configfile);
}
// Copy custom config file
if(is_file($conf['ispconfig_install_dir'].'/server/conf-custom/install/dovecot_custom.conf.master')) {
copy($conf['ispconfig_install_dir'].'/server/conf-custom/install/dovecot_custom.conf.master', $config_dir.'/conf.d/99-ispconfig-custom-config.conf');
}
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = postmaster@example.com', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
replaceLine($config_dir.'/'.$configfile, 'postmaster_address = webmaster@localhost', 'postmaster_address = postmaster@'.$conf['hostname'], 1, 0);
if(version_compare($dovecot_version, 2.1, '<')) {
......
# Do not change this file, as changes will be overwritten by any ISPConfig update.
# Put your custom settings in /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master.
# To start using those changes, do a force upgrade and let it reconfigure your services. (ispconfig_update.sh --force)
listen = *,[::]
protocols = imap pop3
auth_mechanisms = plain login
......@@ -88,7 +91,7 @@ protocol lmtp {
#2.3+ group = vmail
#2.3+ mode = 0660
#2.3+ }
#2.3+
#2.3+
#2.3+ unix_listener stats-writer {
#2.3+ user = vmail
#2.3+ group = vmail
......@@ -131,3 +134,4 @@ namespace inbox {
special_use = \Trash
}
}
!include_try conf.d/99-ispconfig-custom-config.conf
# Do not change this file, as changes will be overwritten by any ISPConfig update.
# Put your custom settings in /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master.
# To start using those changes, do a force upgrade and let it reconfigure your services. (ispconfig_update.sh --force)
listen = *,[::]
protocols = imap pop3
auth_mechanisms = plain login
......@@ -86,7 +89,7 @@ protocol lmtp {
#2.3+ group = vmail
#2.3+ mode = 0660
#2.3+ }
#2.3+
#2.3+
#2.3+ unix_listener stats-writer {
#2.3+ user = vmail
#2.3+ group = vmail
......@@ -108,3 +111,4 @@ plugin {
quota_status_nouser = DUNNO
quota_status_overquota = "552 5.2.2 Mailbox is full"
}
!include_try conf.d/99-ispconfig-custom-config.conf
# You can use this file for custom Dovecot settings. The used settings will overrule the settings set by ISPConfig.
# Use with caution!
# Put this file in /usr/local/ispconfig/server/conf-custom/install/ and make your changes there.
# Do not change this file, as changes will be overwritten by any ISPConfig update.
# Put your custom settings in /usr/local/ispconfig/server/conf-custom/install/dovecot_custom.conf.master.
# To start using those changes, do a force upgrade and let it reconfigure your services. (ispconfig_update.sh --force)
listen = *,[::]
protocols = imap pop3
auth_mechanisms = plain login
......@@ -82,7 +85,7 @@ protocol lmtp {
#2.3+ group = vmail
#2.3+ mode = 0660
#2.3+ }
#2.3+
#2.3+
#2.3+ unix_listener stats-writer {
#2.3+ user = vmail
#2.3+ group = vmail
......@@ -125,3 +128,4 @@ namespace inbox {
special_use = \Trash
}
}
!include_try conf.d/99-ispconfig-custom-config.conf
# You can use this file for custom Postfix settings. The used settings will overrule the settings set by ISPConfig.
# Use with caution!
# Put this file in /usr/local/ispconfig/server/conf-custom/install/ and make your changes there.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment