diff --git a/install/lib/installer_base.lib.php b/install/lib/installer_base.lib.php index 6cc4de996ab17a97bcbc827c372b87110a6a06ef..be78cb635149a039512050e6c5c1565080586fbb 100644 --- a/install/lib/installer_base.lib.php +++ b/install/lib/installer_base.lib.php @@ -1071,6 +1071,14 @@ class installer_base { return true; } + public function get_postfix_version() { + //* Get postfix version + exec('postconf -d mail_version 2>&1', $out); + $postfix_version = preg_replace('/.*=\s*/', '', $out[0]); + unset($out); + return $postfix_version; + } + public function configure_postfix($options = '') { global $conf,$autoinstall; $cf = $conf['postfix']; @@ -1080,10 +1088,7 @@ class installer_base { $this->error("The postfix configuration directory '$config_dir' does not exist."); } - //* Get postfix version - exec('postconf -d mail_version 2>&1', $out); - $postfix_version = preg_replace('/.*=\s*/', '', $out[0]); - unset($out); + $postfix_version = $this->get_postfix_version(); //* Install virtual mappings foreach (glob('tpl/mysql-virtual_*.master') as $filename) { @@ -1482,8 +1487,7 @@ class installer_base { $config_dir = $conf['postfix']['config_dir']; $quoted_config_dir = preg_quote($config_dir, '|'); - $postfix_version = `postconf -d mail_version 2>/dev/null`; - $postfix_version = preg_replace( '/mail_version\s*=\s*(.*)\s*/', '$1', $postfix_version ); + $postfix_version = $this->get_postfix_version(); //* Configure master.cf and add a line for deliver if(!$this->get_postfix_service('dovecot', 'unix')) { @@ -1725,6 +1729,7 @@ class installer_base { break; } } + $postfix_version = $this->get_postfix_version(); # postfix < 3.3 needs this when using reject_unverified_recipient: if(version_compare($postfix_version, 3.3, '<')) { $postconf_commands[] = "enable_original_recipient = yes";