diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 3a0f87af1e6967968197e15c29d115e6a389ed24..a92b821d1d797fb766e0c60d42f9a964950c85a7 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -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, '<')) { diff --git a/install/tpl/debian6_dovecot2.conf.master b/install/tpl/debian6_dovecot2.conf.master index 5032488a6f1e0d2066316f989268f00aad033ce9..91d745bc39ec56d01ba2b8be017673d76b1a91d5 100644 --- a/install/tpl/debian6_dovecot2.conf.master +++ b/install/tpl/debian6_dovecot2.conf.master @@ -1,3 +1,6 @@ +# 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 diff --git a/install/tpl/debian_dovecot2.conf.master b/install/tpl/debian_dovecot2.conf.master index 4a44bfbfc6a63ef05e4e310464533fc1d15eb385..acbb5ccdff11a01fabe0b59b6b9bd7a31d4ee46e 100644 --- a/install/tpl/debian_dovecot2.conf.master +++ b/install/tpl/debian_dovecot2.conf.master @@ -1,3 +1,6 @@ +# 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 diff --git a/install/tpl/dovecot_custom.conf.master b/install/tpl/dovecot_custom.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..dab73e5a09772417a31d3b45e4c8a36ef82b63e4 --- /dev/null +++ b/install/tpl/dovecot_custom.conf.master @@ -0,0 +1,3 @@ +# 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. diff --git a/install/tpl/fedora_dovecot2.conf.master b/install/tpl/fedora_dovecot2.conf.master index 81d71a37fec28ca8a13e92b4c582afc65e8ff208..0b31c23b4e159430863511213f5e5868a3867fb1 100644 --- a/install/tpl/fedora_dovecot2.conf.master +++ b/install/tpl/fedora_dovecot2.conf.master @@ -1,3 +1,6 @@ +# 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 diff --git a/install/tpl/postfix_custom.conf.master b/install/tpl/postfix_custom.conf.master new file mode 100644 index 0000000000000000000000000000000000000000..4f3f2124c84cef97f30c6d6206c62fdf140b56b2 --- /dev/null +++ b/install/tpl/postfix_custom.conf.master @@ -0,0 +1,3 @@ +# 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.