From 06cff22caaa8c0100bcca296fad79eef408833a9 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Thu, 12 Dec 2013 14:27:24 +0100 Subject: [PATCH] allow custom sendmail_path value in php.ini when using php-fpm, fixes #1323 Signed-off-by: Michael Kaufmann (d00p) --- lib/classes/phpinterface/class.phpinterface_fpm.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/classes/phpinterface/class.phpinterface_fpm.php b/lib/classes/phpinterface/class.phpinterface_fpm.php index 1eae275c..be273494 100644 --- a/lib/classes/phpinterface/class.phpinterface_fpm.php +++ b/lib/classes/phpinterface/class.phpinterface_fpm.php @@ -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); }