Marius Cramer
2014-02-18 8ddcb0d7ac2141b934c789cd7b5cf06f05e730b0
install/dist/lib/fedora.lib.php
@@ -152,6 +152,19 @@
      //* mysql-virtual_relayrecipientmaps.cf
      $this->process_postfix_config('mysql-virtual_relayrecipientmaps.cf');
      //* postfix-dkim
      $full_file_name=$config_dir.'/tag_as_originating.re';
      if(is_file($full_file_name)) {
         copy($full_file_name, $config_dir.$configfile.'~');
      }
      wf($full_file_name, '/^/ FILTER amavis:[127.0.0.1]:10026');
      $full_file_name=$config_dir.'/tag_as_foreign.re';
      if(is_file($full_file_name)) {
         copy($full_file_name, $config_dir.$configfile.'~');
      }
      wf($full_file_name, '/^/ FILTER amavis:[127.0.0.1]:10024');
      //* Changing mode and group of the new created config files.
      caselog('chmod o= '.$config_dir.'/mysql-virtual_*.cf* &> /dev/null',
         __FILE__, __LINE__, 'chmod on mysql-virtual_*.cf*', 'chmod on mysql-virtual_*.cf* failed');
@@ -389,7 +402,7 @@
      // Adding the amavisd commands to the postfix configuration
      $postconf_commands = array (
         'dovecot_destination_recipient_limit = 1',
         'virtual_transport = dovecot',
         'virtual_transport = lmtp:unix:private/dovecot-lmtp',
         'smtpd_sasl_type = dovecot',
         'smtpd_sasl_path = private/auth',
         'receive_override_options = no_address_mappings'
@@ -448,6 +461,9 @@
      exec("chmod 600 $config_dir/$configfile");
      exec("chown root:root $config_dir/$configfile");
      // Dovecot shall ignore mounts in website directory
      exec("doveadm mount add '/var/www/*' ignore");
   }
@@ -484,13 +500,25 @@
      }
      // Append the configuration for amavisd to the master.cf file
      if(is_file($conf["postfix"]["config_dir"].'/master.cf')) copy($conf["postfix"]["config_dir"].'/master.cf', $conf["postfix"]["config_dir"].'/master.cf~');
      $content = rf($conf["postfix"]["config_dir"].'/master.cf');
      if(is_file($conf['postfix']['config_dir'].'/master.cf')) copy($conf['postfix']['config_dir'].'/master.cf', $conf['postfix']['config_dir'].'/master.cf~');
      $content = rf($conf['postfix']['config_dir'].'/master.cf');
      // Only add the content if we had not addded it before
      if(!stristr($content, "127.0.0.1:10025")) {
      if(!preg_match('/^amavis\s+unix\s+/m', $content)) {
         unset($content);
         $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', "tpl/master_cf_amavis.master");
         af($conf["postfix"]["config_dir"].'/master.cf', $content);
         $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis.master', 'tpl/master_cf_amavis.master');
         af($conf['postfix']['config_dir'].'/master.cf', $content);
         $content = rf($conf['postfix']['config_dir'].'/master.cf');
      }
      if(!preg_match('/^127.0.0.1:10025\s+/m', $content)) {
         unset($content);
         $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10025.master', 'tpl/master_cf_amavis10025.master');
         af($conf['postfix']['config_dir'].'/master.cf', $content);
         $content = rf($conf['postfix']['config_dir'].'/master.cf');
      }
      if(!preg_match('/^127.0.0.1:10027\s+/m', $content)) {
         unset($content);
         $content = rfsel($conf['ispconfig_install_dir'].'/server/conf-custom/install/master_cf_amavis10027.master', 'tpl/master_cf_amavis10027.master');
         af($conf['postfix']['config_dir'].'/master.cf', $content);
      }
      unset($content);
@@ -1142,14 +1170,14 @@
      //exec('chmod +r /var/log/clamav/freshclam.log');
      //* Install the update script
      if(is_file('/usr/local/bin/ispconfig_update_from_svn.sh')) unlink('/usr/local/bin/ispconfig_update_from_svn.sh');
      exec('chown root /usr/local/ispconfig/server/scripts/update_from_svn.sh');
      exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_svn.sh');
      if(is_file('/usr/local/bin/ispconfig_update_from_dev.sh')) unlink('/usr/local/bin/ispconfig_update_from_dev.sh');
      exec('chown root /usr/local/ispconfig/server/scripts/update_from_dev.sh');
      exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_dev.sh');
      exec('chown root /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
      exec('chmod 700 /usr/local/ispconfig/server/scripts/update_from_tgz.sh');
      exec('chown root /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
      exec('chmod 700 /usr/local/ispconfig/server/scripts/ispconfig_update.sh');
      if(!is_link('/usr/local/bin/ispconfig_update_from_svn.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_svn.sh');
      if(!is_link('/usr/local/bin/ispconfig_update_from_dev.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update_from_dev.sh');
      if(!is_link('/usr/local/bin/ispconfig_update.sh')) exec('ln -s /usr/local/ispconfig/server/scripts/ispconfig_update.sh /usr/local/bin/ispconfig_update.sh');
      // set the fast cgi starter script to executable