Skip to content

Commit

Permalink
myhostname placeholder needs to be regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jnorell committed Feb 9, 2016
1 parent 709aed2 commit c757eec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions install/lib/installer_base.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,14 +896,16 @@ public function configure_postfix($options = '') {
}
unset($server_ini_array);

$tmp = str_replace('.','\.',$conf['hostname']);

$postconf_placeholders = array('{config_dir}' => $config_dir,
'{vmail_mailbox_base}' => $cf['vmail_mailbox_base'],
'{vmail_userid}' => $cf['vmail_userid'],
'{vmail_groupid}' => $cf['vmail_groupid'],
'{rbl_list}' => $rbl_list,
'{greylisting}' => $greylisting,
'{reject_slm}' => $reject_sender_login_mismatch,
'{myhostname}' => $conf['hostname'],
'{myhostname}' => $tmp,
);

$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/debian_postfix.conf.master', 'tpl/debian_postfix.conf.master');
Expand Down Expand Up @@ -938,8 +940,8 @@ public function configure_postfix($options = '') {
$configfile = 'helo_access';
if(is_file($config_dir.'/'.$configfile)) {
copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~');
chmod($config_dir.'/'.$configfile.'~', 0400);
}
chmod($config_dir.'/'.$configfile.'~', 0400);
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
$content = strtr($content, $postconf_placeholders);
# todo: look up this server's ip addrs and loop through each
Expand All @@ -949,8 +951,8 @@ public function configure_postfix($options = '') {
$configfile = 'blacklist_helo';
if(is_file($config_dir.'/'.$configfile)) {
copy($config_dir.'/'.$configfile, $config_dir.'/'.$configfile.'~');
chmod($config_dir.'/'.$configfile.'~', 0400);
}
chmod($config_dir.'/'.$configfile.'~', 0400);
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
$content = strtr($content, $postconf_placeholders);
wf($config_dir.'/'.$configfile, $content);
Expand Down
2 changes: 1 addition & 1 deletion install/tpl/helo_access.master
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# be sure to list your own hostname(s), domain(s) and IP address(es) here

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

Expand Down

0 comments on commit c757eec

Please sign in to comment.