Skip to content

Commit c757eec

Browse files
committed
myhostname placeholder needs to be regex
1 parent 709aed2 commit c757eec

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

install/lib/installer_base.lib.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,14 +896,16 @@ public function configure_postfix($options = '') {
896896
}
897897
unset($server_ini_array);
898898

899+
$tmp = str_replace('.','\.',$conf['hostname']);
900+
899901
$postconf_placeholders = array('{config_dir}' => $config_dir,
900902
'{vmail_mailbox_base}' => $cf['vmail_mailbox_base'],
901903
'{vmail_userid}' => $cf['vmail_userid'],
902904
'{vmail_groupid}' => $cf['vmail_groupid'],
903905
'{rbl_list}' => $rbl_list,
904906
'{greylisting}' => $greylisting,
905907
'{reject_slm}' => $reject_sender_login_mismatch,
906-
'{myhostname}' => $conf['hostname'],
908+
'{myhostname}' => $tmp,
907909
);
908910

909911
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_postfix.conf.master', 'tpl/debian_postfix.conf.master');
@@ -938,8 +940,8 @@ public function configure_postfix($options = '') {
938940
$configfile = 'helo_access';
939941
if(is_file($config_dir.'/'.$configfile)) {
940942
copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~');
943+
chmod($config_dir.'/'.$configfile.'~', 0400);
941944
}
942-
chmod($config_dir.'/'.$configfile.'~', 0400);
943945
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
944946
$content = strtr($content, $postconf_placeholders);
945947
# todo: look up this server's ip addrs and loop through each
@@ -949,8 +951,8 @@ public function configure_postfix($options = '') {
949951
$configfile = 'blacklist_helo';
950952
if(is_file($config_dir.'/'.$configfile)) {
951953
copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~');
954+
chmod($config_dir.'/'.$configfile.'~', 0400);
952955
}
953-
chmod($config_dir.'/'.$configfile.'~', 0400);
954956
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
955957
$content = strtr($content, $postconf_placeholders);
956958
wf($config_dir.'/'.$configfile, $content);

install/tpl/helo_access.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# be sure to list your own hostname(s), domain(s) and IP address(es) here
33

44
# Reject others identifying with this machine's hostnames and IP addresses
5-
{myhostname} REJECT
5+
/^{myhostname}$/ REJECT
66
#/^((smtp|mx|mail)\.domain1\.com$/ REJECT
77
#/^mail\.domain2\.com$/ REJECT
88

0 commit comments

Comments
 (0)