Skip to content

Commit a29401d

Browse files
committed
Add new function for custom config usage for Postfix and Dovecot (#5988)
1 parent 1edf68e commit a29401d

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

install/lib/installer_base.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,12 @@ public function configure_postfix($options = '') {
11821182
$content = strtr($content, $postconf_placeholders);
11831183
$postconf_commands = array_merge($postconf_commands, array_filter(explode("\n", $content)));
11841184
}
1185+
if(file_exists($conf['ispconfig_install_dir'].'/server/conf-custom/install/postfix_custom.conf.master')) {
1186+
$configfile = 'postfix_custom.conf';
1187+
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master');
1188+
$content = strtr($content, $postconf_placeholders);
1189+
$postconf_commands = array_merge($postconf_commands, array_filter(explode("\n", $content)));
1190+
}
11851191

11861192
// Remove comment lines, these would give fatal errors when passed to postconf.
11871193
$postconf_commands = array_filter($postconf_commands, function($line) { return preg_match('/^[^#]/', $line); });

install/tpl/debian6_dovecot2.conf.master

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Do not change this file, as changes will be overwritten by any ISPConfig update. Put your custom settings in /etc/dovecot/conf.d/99-custom-config.conf
12
listen = *,[::]
23
protocols = imap pop3
34
auth_mechanisms = plain login
@@ -88,7 +89,7 @@ protocol lmtp {
8889
#2.3+ group = vmail
8990
#2.3+ mode = 0660
9091
#2.3+ }
91-
#2.3+
92+
#2.3+
9293
#2.3+ unix_listener stats-writer {
9394
#2.3+ user = vmail
9495
#2.3+ group = vmail
@@ -131,3 +132,4 @@ namespace inbox {
131132
special_use = \Trash
132133
}
133134
}
135+
!include_try conf.d/99-custom-config.conf

install/tpl/debian_dovecot2.conf.master

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Do not change this file, as changes will be overwritten by any ISPConfig update. Put your custom settings in /etc/dovecot/conf.d/99-custom-config.conf
12
listen = *,[::]
23
protocols = imap pop3
34
auth_mechanisms = plain login
@@ -86,7 +87,7 @@ protocol lmtp {
8687
#2.3+ group = vmail
8788
#2.3+ mode = 0660
8889
#2.3+ }
89-
#2.3+
90+
#2.3+
9091
#2.3+ unix_listener stats-writer {
9192
#2.3+ user = vmail
9293
#2.3+ group = vmail
@@ -108,3 +109,4 @@ plugin {
108109
quota_status_nouser = DUNNO
109110
quota_status_overquota = "552 5.2.2 Mailbox is full"
110111
}
112+
!include_try conf.d/99-custom-config.conf

install/tpl/fedora_dovecot2.conf.master

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Do not change this file, as changes will be overwritten by any ISPConfig update. Put your custom settings in /etc/dovecot/conf.d/99-custom-config.conf
12
listen = *,[::]
23
protocols = imap pop3
34
auth_mechanisms = plain login
@@ -82,7 +83,7 @@ protocol lmtp {
8283
#2.3+ group = vmail
8384
#2.3+ mode = 0660
8485
#2.3+ }
85-
#2.3+
86+
#2.3+
8687
#2.3+ unix_listener stats-writer {
8788
#2.3+ user = vmail
8889
#2.3+ group = vmail
@@ -125,3 +126,4 @@ namespace inbox {
125126
special_use = \Trash
126127
}
127128
}
129+
!include_try conf.d/99-custom-config.conf
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# You can use this file for custom Postfix settings. The used settings will overrule the settings set by ISPConfig.
2+
# Use with caution!
3+
# Put this file in /usr/local/ispconfig/server/conf-custom/install/ and make your changes there.

0 commit comments

Comments
 (0)