allow custom sendmail_path value in php.ini when using php-fpm, fixes #1323

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-12-12 14:27:24 +01:00
parent aa7d1d3f48
commit 06cff22caa

View File

@@ -74,6 +74,7 @@ class phpinterface_fpm {
'variables_order',
'gpc_order',
'date.timezone',
'sendmail_path',
'session.gc_divisor',
'session.gc_probability'
),
@@ -178,14 +179,11 @@ class phpinterface_fpm {
if (!is_dir($tmpdir)) {
$this->getTempDir();
}
//$slowlog = makeCorrectFile($this->_settings['system']['logfiles_directory'] . $this->_domain['loginname'] . '/php-fpm_slow.log');
$fpm_config.= 'env[TMP] = '.$tmpdir."\n";
$fpm_config.= 'env[TMPDIR] = '.$tmpdir."\n";
$fpm_config.= 'env[TEMP] = '.$tmpdir."\n";
$fpm_config.= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f '.$this->_domain['email']."\n";
$openbasedir = '';
if ($this->_domain['loginname'] != 'froxlor.panel') {
if ($this->_domain['openbasedir'] == '1') {
@@ -256,6 +254,12 @@ class phpinterface_fpm {
}
}
// now check if 'sendmail_path' has not beed set in the custom-php.ini
// if not we use our fallback-default as usual
if (strpos($fpm_config, 'php_admin_value[sendmail_path]') === false) {
$fpm_config.= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f '.$this->_domain['email']."\n";
}
fwrite($fh, $fpm_config, strlen($fpm_config));
fclose($fh);
}