"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "install/dist/lib/fedora.lib.php" between
ISPConfig-3.2.4.tar.gz and ISPConfig-3.2.5.tar.gz

About: ISPConfig is an ISP management and Hosting Control Panel (for different Managed Services).

fedora.lib.php  (ISPConfig-3.2.4):fedora.lib.php  (ISPConfig-3.2.5)
skipping to change at line 50 skipping to change at line 50
swriteln($inst->lng(' <Directory />')); swriteln($inst->lng(' <Directory />'));
swriteln($inst->lng(' Options None')); swriteln($inst->lng(' Options None'));
swriteln($inst->lng(' AllowOverride None')); swriteln($inst->lng(' AllowOverride None'));
swriteln($inst->lng(' Require all denied')); swriteln($inst->lng(' Require all denied'));
swriteln($inst->lng(' </Directory>'."\n")); swriteln($inst->lng(' </Directory>'."\n"));
swriteln($inst->lng(' If it uses the old syntax (deny from all) ISPConfig would fail to work.')); swriteln($inst->lng(' If it uses the old syntax (deny from all) ISPConfig would fail to work.'));
} }
} }
function configure_postfix($options = '')
{
global $conf,$autoinstall;
$cf = $conf['postfix'];
$config_dir = $cf['config_dir'];
if(!is_dir($config_dir)){
$this->error("The postfix configuration directory '$confi
g_dir' does not exist.");
}
//* Install virtual mappings
foreach (glob('tpl/mysql-virtual_*.master') as $filename) {
$this->process_postfix_config( basename($filename, '.mast
er') );
}
//* mysql-verify_recipients.cf
$this->process_postfix_config('mysql-verify_recipients.cf');
//* postfix-dkim
$filename='tag_as_originating.re';
$full_file_name=$config_dir.'/'.$filename;
if(is_file($full_file_name)) copy($full_file_name, $full_file_nam
e.'~');
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus
tom/install/postfix-'.$filename.'.master', 'tpl/postfix-'.$filename.'.master');
wf($full_file_name, $content);
$filename='tag_as_foreign.re';
$full_file_name=$config_dir.'/'.$filename;
if(is_file($full_file_name)) copy($full_file_name, $full_file_nam
e.'~');
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus
tom/install/postfix-'.$filename.'.master', 'tpl/postfix-'.$filename.'.master');
wf($full_file_name, $content);
//* Creating virtual mail user and group
$command = 'groupadd -g '.$cf['vmail_groupid'].' '.$cf['vmail_gro
upname'];
if(!is_group($cf['vmail_groupname'])) caselog($command.' &> /dev/
null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command
$command");
$command = 'useradd -g '.$cf['vmail_groupname'].' -u '.$cf['vmail
_userid'].' '.$cf['vmail_username'].' -d '.$cf['vmail_mailbox_base'].' -m';
if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/nul
l", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $co
mmand");
//* These postconf commands will be executed on installation and
update
$server_ini_rec = $this->db->queryOneRecord("SELECT config FROM s
erver WHERE server_id = ?", $conf['server_id']);
$server_ini_array = ini_to_array(stripslashes($server_ini_rec['co
nfig']));
unset($server_ini_rec);
//* If there are RBL's defined, format the list and add them to s
mtp_recipient_restrictions to prevent removeal after an update
$rbl_list = '';
if (@isset($server_ini_array['mail']['realtime_blackhole_list'])
&& $server_ini_array['mail']['realtime_blackhole_list'] != '') {
$rbl_hosts = explode(",", str_replace(" ", "", $server_in
i_array['mail']['realtime_blackhole_list']));
foreach ($rbl_hosts as $key => $value) {
$rbl_list .= ", reject_rbl_client ". $value;
}
}
unset($rbl_hosts);
//* If Postgrey is installed, configure it
$greylisting = '';
if($conf['postgrey']['installed'] == true) {
$greylisting = ', check_recipient_access mysql:/etc/postf
ix/mysql-virtual_policy_greylist.cf';
}
$reject_sender_login_mismatch = '';
$reject_authenticated_sender_login_mismatch = '';
if(isset($server_ini_array['mail']['reject_sender_login_mismatch'
]) && ($server_ini_array['mail']['reject_sender_login_mismatch'] == 'y')) {
$reject_sender_login_mismatch = ', reject_sender_login_mi
smatch';
$reject_authenticated_sender_login_mismatch = 'reject_aut
henticated_sender_login_mismatch, ';
}
# placeholder includes comment char
$stress_adaptive_placeholder = '#{stress_adaptive} ';
$stress_adaptive = (isset($server_ini_array['mail']['stress_adapt
ive']) && ($server_ini_array['mail']['stress_adaptive'] == 'y')) ? '' : $stress_
adaptive_placeholder;
$reject_unknown_client_hostname='';
if (isset($server_ini_array['mail']['reject_unknown']) && ($serve
r_ini_array['mail']['reject_unknown'] == 'client' || $server_ini_array['mail']['
reject_unknown'] == 'client_helo')) {
$reject_unknown_client_hostname=',reject_unknown_client_h
ostname';
}
$reject_unknown_helo_hostname='';
if ((!isset($server_ini_array['mail']['reject_unknown'])) || $ser
ver_ini_array['mail']['reject_unknown'] == 'helo' || $server_ini_array['mail']['
reject_unknown'] == 'client_helo') {
$reject_unknown_helo_hostname=',reject_unknown_helo_hostn
ame';
}
unset($server_ini_array);
$myhostname = 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,
'{reject_aslm}' => $reject_authenticated_sender_login_mis
match,
'{myhostname}' => $myhostname,
$stress_adaptive_placeholder => $stress_adaptive,
'{reject_unknown_client_hostname}' => $reject_unknown_cli
ent_hostname,
'{reject_unknown_helo_hostname}' => $reject_unknown_helo_
hostname,
);
$postconf_tpl = rfsel($conf['ispconfig_install_dir'].'/server/con
f-custom/install/fedora_postfix.conf.master', 'tpl/fedora_postfix.conf.master');
$postconf_tpl = strtr($postconf_tpl, $postconf_placeholders);
$postconf_commands = array_filter(explode("\n", $postconf_tpl));
// read and remove empty lines
//* These postconf commands will be executed on installation only
if($this->is_update == false) {
$postconf_commands = array_merge($postconf_commands, arra
y(
'myhostname = '.$conf['hostname'],
'mydestination = '.$conf['hostname'].', l
ocalhost, localhost.localdomain',
'mynetworks = 127.0.0.0/8 [::1]/128'
));
}
//* Create the header and body check files
touch($config_dir.'/header_checks');
touch($config_dir.'/mime_header_checks');
touch($config_dir.'/nested_header_checks');
touch($config_dir.'/body_checks');
touch($config_dir.'/sasl_passwd');
//* Create the mailman files
if(!is_dir('/var/lib/mailman/data')) exec('mkdir -p /var/lib/mail
man/data');
//if(!is_file('/var/lib/mailman/data/aliases')) touch('/var/lib/m
ailman/data/aliases');
if(is_file('/var/lib/mailman/data/aliases')) unlink('/var/lib/mai
lman/data/aliases');
if(!is_link('/var/lib/mailman/data/aliases')) symlink('/etc/mailm
an/aliases', '/var/lib/mailman/data/aliases');
if(!is_dir('/etc/mailman')) mkdir('/etc/mailman');
if(!is_file('/etc/mailman/aliases')) touch('/etc/mailman/aliases'
);
exec('postalias /var/lib/mailman/data/aliases');
if(!is_file('/etc/mailman/virtual-mailman')) touch('/etc/mailman/
virtual-mailman');
exec('postmap /etc/mailman/virtual-mailman');
if(!is_file('/var/lib/mailman/data/transport-mailman')) touch('/v
ar/lib/mailman/data/transport-mailman');
exec('/usr/sbin/postmap /var/lib/mailman/data/transport-mailman')
;
//* Create auxillary postfix conf files
$configfile = 'helo_access';
if(is_file($config_dir.'/'.$configfile)) {
copy($config_dir.'/'.$configfile, $config_dir.'/'.$config
file.'~');
chmod($config_dir.'/'.$configfile.'~', 0400);
}
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus
tom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
$content = strtr($content, $postconf_placeholders);
# todo: look up this server's ip addrs and loop through each
# todo: look up domains hosted on this server and loop through ea
ch
wf($config_dir.'/'.$configfile, $content);
$configfile = 'blacklist_helo';
if(is_file($config_dir.'/'.$configfile)) {
copy($config_dir.'/'.$configfile, $config_dir.'/'.$config
file.'~');
chmod($config_dir.'/'.$configfile.'~', 0400);
}
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus
tom/install/'.$configfile.'.master', 'tpl/'.$configfile.'.master');
$content = strtr($content, $postconf_placeholders);
wf($config_dir.'/'.$configfile, $content);
//* Make a backup copy of the main.cf file
copy($config_dir.'/main.cf', $config_dir.'/main.cf~');
//* Executing the postconf commands
foreach($postconf_commands as $cmd) {
$command = "postconf -e '$cmd'";
caselog($command." &> /dev/null", __FILE__, __LINE__, 'EX
ECUTED: '.$command, 'Failed to execute the command '.$command);
}
if(!stristr($options, 'dont-create-certs')) {
//* Create the SSL certificate
if(AUTOINSTALL){
$command = 'cd '.$config_dir.'; '
."openssl req -new -subj '/C=".escapeshel
lcmd($autoinstall['ssl_cert_country'])."/ST=".escapeshellcmd($autoinstall['ssl_c
ert_state'])."/L=".escapeshellcmd($autoinstall['ssl_cert_locality'])."/O=".escap
eshellcmd($autoinstall['ssl_cert_organisation'])."/OU=".escapeshellcmd($autoinst
all['ssl_cert_organisation_unit'])."/CN=".escapeshellcmd($autoinstall['ssl_cert_
common_name'])."' -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout s
mtpd.key -keyform PEM -days 3650 -x509";
} else {
$command = 'cd '.$config_dir.'; '
.'openssl req -new -outform PEM -out smtp
d.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509';
}
exec($command);
$command = 'chmod o= '.$config_dir.'/smtpd.key';
caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EX
ECUTED: '.$command, 'Failed to execute the command '.$command);
}
//** We have to change the permissions of the courier authdaemon
directory to make it accessible for maildrop.
$command = 'chmod 755 /var/spool/authdaemon';
caselog($command.' &> /dev/null', __FILE__, __LINE__, 'EXECUTED:
'.$command, 'Failed to execute the command '.$command);
//* Changing maildrop lines in posfix master.cf
if(is_file($config_dir.'/master.cf')){
copy($config_dir.'/master.cf', $config_dir.'/master.cf~')
;
}
if(is_file($config_dir.'/master.cf~')){
exec('chmod 400 '.$config_dir.'/master.cf~');
}
$configfile = $config_dir.'/master.cf';
$content = rf($configfile);
// if postfix package is from fedora or centios main repo
$content = str_replace('# flags=DRhu user=vmail argv=/usr/local/
bin/maildrop -d ${recipient}',
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bi
n/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender
}',
$content);
// If postfix package is from centos plus repo
$content = str_replace('# flags=DRhu user=vmail argv=/usr/bin/ma
ildrop -d ${recipient}',
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bi
n/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender
}',
$content);
$content = str_replace(' flags=DRhu user=vmail argv=/usr/local/b
in/maildrop -d ${recipient}',
' flags=DRhu user='.$cf['vmail_username'].' argv=/usr/bi
n/maildrop -d ${recipient} ${extension} ${recipient} ${user} ${nexthop} ${sender
}',
$content);
$content = str_replace('#maildrop unix - n n
- - pipe',
'maildrop unix - n n - -
pipe',
$content);
wf($configfile, $content);
//* Writing the Maildrop mailfilter file
$configfile = 'mailfilter';
if(is_file($cf['vmail_mailbox_base'].'/.'.$configfile)){
copy($cf['vmail_mailbox_base'].'/.'.$configfile, $cf['vma
il_mailbox_base'].'/.'.$configfile.'~');
}
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus
tom/install/'.$configfile.'.master', "tpl/$configfile.master");
$content = str_replace('{dist_postfix_vmail_mailbox_base}', $cf['
vmail_mailbox_base'], $content);
wf($cf['vmail_mailbox_base'].'/.'.$configfile, $content);
//* Create the directory for the custom mailfilters
$command = 'mkdir '.$cf['vmail_mailbox_base'].'/mailfilters';
caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED:
$command", "Failed to execute the command $command");
//* Chmod and chown the .mailfilter file
$command = 'chown -R '.$cf['vmail_username'].':'.$cf['vmail_group
name'].' '.$cf['vmail_mailbox_base'].'/.mailfilter';
caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED:
$command", "Failed to execute the command $command");
$command = 'chmod -R 600 '.$cf['vmail_mailbox_base'].'/.mailfilte
r';
caselog($command." &> /dev/null", __FILE__, __LINE__, "EXECUTED:
$command", "Failed to execute the command $command");
}
public function configure_saslauthd() { public function configure_saslauthd() {
global $conf; global $conf;
$configfile = 'tpl/fedora_saslauthd_smtpd_conf.master'; $configfile = 'tpl/fedora_saslauthd_smtpd_conf.master';
$content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus tom/install/fedora_saslauthd_smtpd_conf.master', $configfile); $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-cus tom/install/fedora_saslauthd_smtpd_conf.master', $configfile);
wf('/usr/lib/sasl2/smtpd.conf', $content); wf('/usr/lib/sasl2/smtpd.conf', $content);
if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl/smtpd.conf', $conten t); if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl/smtpd.conf', $conten t);
if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl2/smtpd.conf', $conte nt); if(is_dir('/usr/lib64')) wf('/usr/lib64/sasl2/smtpd.conf', $conte nt);
} }
 End of changes. 1 change blocks. 
311 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)