Skip to content

Commit a32f99a

Browse files
committed
add server config checkbox for postfix stress adaptive behavior
1 parent df75da9 commit a32f99a

34 files changed

+147
-25
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ function configure_postfix($options = '')
156156
if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) {
157157
$reject_sender_login_mismatch = ', reject_sender_login_mismatch';
158158
}
159+
160+
# placeholder includes comment char
161+
$stress_adaptive_placeholder = '#{stress_adaptive} ';
162+
$stress_adaptive = (isset($server_ini_array['mail']['stress_adaptive']) && ($server_ini_array['mail']['stress_adaptive'] == 'y')) ? '' : $stress_adaptive_placeholder;
163+
159164
unset($server_ini_array);
160165

161166
$postconf_placeholders = array('{config_dir}' => $config_dir,
@@ -165,6 +170,7 @@ function configure_postfix($options = '')
165170
'{rbl_list}' => $rbl_list,
166171
'{greylisting}' => $greylisting,
167172
'{reject_slm}' => $reject_sender_login_mismatch,
173+
$stress_adaptive_placeholder => $stress_adaptive,
168174
);
169175

170176
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/fedora_postfix.conf.master', 'tpl/fedora_postfix.conf.master');

install/dist/lib/gentoo.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public function configure_postfix($options = '')
105105
if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) {
106106
$reject_sender_login_mismatch = ', reject_sender_login_mismatch';
107107
}
108+
109+
# placeholder includes comment char
110+
$stress_adaptive_placeholder = '#{stress_adaptive} ';
111+
$stress_adaptive = (isset($server_ini_array['mail']['stress_adaptive']) && ($server_ini_array['mail']['stress_adaptive'] == 'y')) ? '' : $stress_adaptive_placeholder;
112+
108113
unset($server_ini_array);
109114

110115
$postconf_placeholders = array('{config_dir}' => $config_dir,
@@ -114,6 +119,7 @@ public function configure_postfix($options = '')
114119
'{rbl_list}' => $rbl_list,
115120
'{greylisting}' => $greylisting,
116121
'{reject_slm}' => $reject_sender_login_mismatch,
122+
$stress_adaptive_placeholder => $stress_adaptive,
117123
);
118124

119125
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/gentoo_postfix.conf.master', 'tpl/gentoo_postfix.conf.master');

install/dist/lib/opensuse.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ function configure_postfix($options = '')
167167
if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) {
168168
$reject_sender_login_mismatch = ', reject_sender_login_mismatch';
169169
}
170+
171+
# placeholder includes comment char
172+
$stress_adaptive_placeholder = '#{stress_adaptive} ';
173+
$stress_adaptive = (isset($server_ini_array['mail']['stress_adaptive']) && ($server_ini_array['mail']['stress_adaptive'] == 'y')) ? '' : $stress_adaptive_placeholder;
174+
170175
unset($server_ini_array);
171176

172177
$postconf_placeholders = array('{config_dir}' => $config_dir,
@@ -176,6 +181,7 @@ function configure_postfix($options = '')
176181
'{rbl_list}' => $rbl_list,
177182
'{greylisting}' => $greylisting,
178183
'{reject_slm}' => $reject_sender_login_mismatch,
184+
$stress_adaptive_placeholder => $stress_adaptive,
179185
);
180186

181187
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/opensuse_postfix.conf.master', 'tpl/opensuse_postfix.conf.master');

install/lib/installer_base.lib.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,11 @@ public function configure_postfix($options = '') {
10801080
if(isset($server_ini_array['mail']['reject_sender_login_mismatch']) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) {
10811081
$reject_sender_login_mismatch = ', reject_sender_login_mismatch';
10821082
}
1083+
1084+
# placeholder includes comment char
1085+
$stress_adaptive_placeholder = '#{stress_adaptive}';
1086+
$stress_adaptive = (isset($server_ini_array['mail']['stress_adaptive']) && ($server_ini_array['mail']['stress_adaptive'] == 'y')) ? '' : $stress_adaptive_placeholder;
1087+
10831088
unset($server_ini_array);
10841089

10851090
$tmp = str_replace('.','\.',$conf['hostname']);
@@ -1092,6 +1097,7 @@ public function configure_postfix($options = '') {
10921097
'{greylisting}' => $greylisting,
10931098
'{reject_slm}' => $reject_sender_login_mismatch,
10941099
'{myhostname}' => $tmp,
1100+
$stress_adaptive_placeholder => $stress_adaptive,
10951101
);
10961102

10971103
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_postfix.conf.master', 'tpl/debian_postfix.conf.master');
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Postfix configuration for version 2.5 and up
22

33
# These will make postfix adapt more to load spikes
4-
#in_flow_delay = ${stress?3}${stress:1}s
5-
#smtp_connect_timeout = ${stress?10}${stress:30}s
6-
#smtp_helo_timeout = ${stress?10}${stress:60}s
7-
#smtp_mail_timeout = ${stress?10}${stress:60}s
8-
#smtpd_error_sleep_time = ${stress?1}${stress:2}s
9-
#smtpd_hard_error_limit = ${stress?1}${stress:10}
10-
#smtpd_recipient_overshoot_limit = ${stress?60}${stress:600}
11-
#smtpd_soft_error_limit = ${stress?2}${stress:5}
12-
#smtpd_timeout = ${stress?10}${stress:60}s
4+
#{stress_adaptive} in_flow_delay = ${stress?3}${stress:1}s
5+
#{stress_adaptive} smtp_connect_timeout = ${stress?10}${stress:30}s
6+
#{stress_adaptive} smtp_helo_timeout = ${stress?10}${stress:60}s
7+
#{stress_adaptive} smtp_mail_timeout = ${stress?10}${stress:60}s
8+
#{stress_adaptive} smtpd_error_sleep_time = ${stress?1}${stress:2}s
9+
#{stress_adaptive} smtpd_hard_error_limit = ${stress?1}${stress:10}
10+
#{stress_adaptive} smtpd_recipient_overshoot_limit = ${stress?60}${stress:600}
11+
#{stress_adaptive} smtpd_soft_error_limit = ${stress?2}${stress:5}
12+
#{stress_adaptive} smtpd_timeout = ${stress?10}${stress:60}s
1313

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Postfix configuration for version 3.0 and up
22

33
# These will make postfix adapt more to load spikes
4-
# in_flow_delay = ${stress?{3}:{1}}s
5-
# smtp_connect_timeout = ${stress?{10}:{30}}s
6-
# smtp_helo_timeout = ${stress?{10}:{60}}s
7-
# smtp_mail_timeout = ${stress?{10}:{60}}s
8-
# smtpd_error_sleep_time = ${stress?{1}:{2}}s
9-
# smtpd_hard_error_limit = ${stress?{1}:{10}}
10-
# smtpd_recipient_overshoot_limit = ${stress?{60}:{600}}
11-
# smtpd_soft_error_limit = ${stress?{2}:{5}}
12-
# smtpd_timeout = ${stress?{10}:{60}}s
4+
#{stress_adaptive} in_flow_delay = ${stress?{3}:{1}}s
5+
#{stress_adaptive} smtp_connect_timeout = ${stress?{10}:{30}}s
6+
#{stress_adaptive} smtp_helo_timeout = ${stress?{10}:{60}}s
7+
#{stress_adaptive} smtp_mail_timeout = ${stress?{10}:{60}}s
8+
#{stress_adaptive} smtpd_error_sleep_time = ${stress?{1}:{2}}s
9+
#{stress_adaptive} smtpd_hard_error_limit = ${stress?{1}:{10}}
10+
#{stress_adaptive} smtpd_recipient_overshoot_limit = ${stress?{60}:{600}}
11+
#{stress_adaptive} smtpd_soft_error_limit = ${stress?{2}:{5}}
12+
#{stress_adaptive} smtpd_timeout = ${stress?{10}:{60}}s
1313

interface/web/admin/form/server_config.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,12 @@
666666
'width' => '40',
667667
'maxlength' => '255'
668668
),
669+
'stress_adaptive' => array (
670+
'datatype' => 'VARCHAR',
671+
'formtype' => 'CHECKBOX',
672+
'default' => 'y',
673+
'value' => array(0 => 'n', 1 => 'y')
674+
),
669675
'mailbox_quota_stats' => array (
670676
'datatype' => 'VARCHAR',
671677
'formtype' => 'CHECKBOX',

interface/web/admin/lib/lang/ar_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ $wb['backup_mode_userzip'] = 'Backup web files owned by web user as zip';
172172
$wb['backup_mode_rootgz'] = 'Backup all files in web directory as root user';
173173
$wb['realtime_blackhole_list_txt'] = 'Real-time Blackhole List';
174174
$wb['realtime_blackhole_list_note_txt'] = '(Separate RBL\'s with commas)';
175+
$wb['stress_adaptive_txt'] = 'Adapt to temporary load spikes';
176+
$wb['tooltip_stress_adaptive_txt'] = 'Enables Postfix stress-adaptive behavior.';
175177
$wb['ssl_settings_txt'] = 'SSL Settings';
176178
$wb['permissions_txt'] = 'Permissions';
177179
$wb['php_settings_txt'] = 'PHP Settings';

interface/web/admin/lib/lang/bg_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ $wb['backup_mode_userzip'] = 'Backup web files owned by web user as zip';
170170
$wb['backup_mode_rootgz'] = 'Backup all files in web directory as root user';
171171
$wb['realtime_blackhole_list_txt'] = 'Real-time Blackhole List';
172172
$wb['realtime_blackhole_list_note_txt'] = '(Separate RBL\'s with commas)';
173+
$wb['stress_adaptive_txt'] = 'Adapt to temporary load spikes';
174+
$wb['tooltip_stress_adaptive_txt'] = 'Enables Postfix stress-adaptive behavior.';
173175
$wb['ssl_settings_txt'] = 'SSL Settings';
174176
$wb['permissions_txt'] = 'Permissions';
175177
$wb['php_settings_txt'] = 'PHP Settings';

interface/web/admin/lib/lang/br_server_config.lng

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ $wb['connect_userid_to_webid_txt'] = 'Conectar o UID do usuário no sistema para
179179
$wb['connect_userid_to_webid_start_txt'] = 'Conexão do ID inicial do usuário com o webID';
180180
$wb['realtime_blackhole_list_txt'] = 'Lista RBL em tempo real';
181181
$wb['realtime_blackhole_list_note_txt'] = '(separar as RBLs com vírgulas)';
182+
$wb['stress_adaptive_txt'] = 'Adapt to temporary load spikes';
183+
$wb['tooltip_stress_adaptive_txt'] = 'Enables Postfix stress-adaptive behavior.';
182184
$wb['ssl_settings_txt'] = 'Configurações SSL';
183185
$wb['permissions_txt'] = 'Permissões';
184186
$wb['php_settings_txt'] = 'Configurações php';

0 commit comments

Comments
 (0)