doc-en icon indicating copy to clipboard operation
doc-en copied to clipboard

mail.force_extra_parameters

Open legecha opened this issue 3 years ago • 1 comments

Description

The following code:

<?php
phpinfo();

With a .user.ini in the same directory as document root containing:

mail.force_extra_parameters="-f [email protected]"
mail.log="/tmp/dmail.log"

Resulted in this output:

...
mail.force_extra_parameters | no value | no value
mail.log | /tmp/dmail.log | no value
...

But I expected this output instead:

...
mail.force_extra_parameters | -f [email protected] | no value
mail.log | /tmp/dmail.log | no value
...

Even though both mail.force_extra_parameters and mail.log are PHP_INI_SYSTEM|PHP_INI_PERDIR.

Note: This is with php8.1-fpm - but I have tried with php7.4-fpm too. With mod_php I have tried php_admin_value with the mail.force_extra_parameters and it does work.

PHP Version

PHP 8.2.0

Operating System

Ubuntu 20.0.4

legecha avatar Dec 13 '22 11:12 legecha

Even though both mail.force_extra_parameters and mail.log are PHP_INI_SYSTEM|PHP_INI_PERDIR.

There are deliberate additional restrictions, though:

https://github.com/php/php-src/blob/a83923044c48982c80804ae1b45e761c271966d3/main/main.c#L644-L647

and

https://github.com/php/php-src/blob/a83923044c48982c80804ae1b45e761c271966d3/main/main.c#L630-L635

The sparse overview of mail.force_extra_parameters already hints at that by claiming the setting would be "php.ini only". The detailed documentation is wrong, though; setting mail.log as PHP_INI_PERDIR silently fails if open_basedir is set, but the given path is outside of it.

cmb69 avatar Dec 13 '22 12:12 cmb69