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:
@@ -74,6 +74,7 @@ class phpinterface_fpm {
|
|||||||
'variables_order',
|
'variables_order',
|
||||||
'gpc_order',
|
'gpc_order',
|
||||||
'date.timezone',
|
'date.timezone',
|
||||||
|
'sendmail_path',
|
||||||
'session.gc_divisor',
|
'session.gc_divisor',
|
||||||
'session.gc_probability'
|
'session.gc_probability'
|
||||||
),
|
),
|
||||||
@@ -178,14 +179,11 @@ class phpinterface_fpm {
|
|||||||
if (!is_dir($tmpdir)) {
|
if (!is_dir($tmpdir)) {
|
||||||
$this->getTempDir();
|
$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[TMP] = '.$tmpdir."\n";
|
||||||
$fpm_config.= 'env[TMPDIR] = '.$tmpdir."\n";
|
$fpm_config.= 'env[TMPDIR] = '.$tmpdir."\n";
|
||||||
$fpm_config.= 'env[TEMP] = '.$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 = '';
|
$openbasedir = '';
|
||||||
if ($this->_domain['loginname'] != 'froxlor.panel') {
|
if ($this->_domain['loginname'] != 'froxlor.panel') {
|
||||||
if ($this->_domain['openbasedir'] == '1') {
|
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));
|
fwrite($fh, $fpm_config, strlen($fpm_config));
|
||||||
fclose($fh);
|
fclose($fh);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user