]> granicus.if.org Git - php/commitdiff
- Added an extra ini setting with which extra commands can be forced to
authorDerick Rethans <derick@php.net>
Wed, 26 Feb 2003 20:04:16 +0000 (20:04 +0000)
committerDerick Rethans <derick@php.net>
Wed, 26 Feb 2003 20:04:16 +0000 (20:04 +0000)
  the sendmail deamon on a per-vhost base. The value in this ini setting
  will override all extra commands passed as the 5th parameter to mail()
  and will work in Safe Mode.
@- Added an extra ini setting (mail_force_extra_paramaters) which forces
@  the addition of the specified parameters to be passed as extra
@  parameters to the sendmail binary. These parameters will always replace
@  the value of the 5th parameter to mail(), even in safe mode. (Derick)

ext/standard/mail.c
main/main.c

index 3dd51cb3dfae311af7c2d35367016fff633d0004..6b4f701734eea8d395804e7a483e9ecf89a29c91 100644 (file)
@@ -86,6 +86,7 @@ PHP_FUNCTION(mail)
        char *subject=NULL, *extra_cmd=NULL;
        int to_len, message_len, headers_len;
        int subject_len, extra_cmd_len, i;
+       char *force_extra_parameters = INI_STR("mail_force_extra_parameters");
 
        if (PG(safe_mode) && (ZEND_NUM_ARGS() == 5)) {
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "SAFE MODE Restriction in effect.  The fifth parameter is disabled in SAFE MODE.");
@@ -137,7 +138,9 @@ PHP_FUNCTION(mail)
                }
        }
 
-       if (extra_cmd) {
+       if (force_extra_parameters) {
+               extra_cmd = estrdup(force_extra_parameters);
+       } else if (extra_cmd) {
                extra_cmd = php_escape_shell_cmd(extra_cmd);
        }
        
index cc61d9486f90eb9eb86060d500b0da068e6b8cf9..c9e36152ddc26ef6ed558517e84997028947d8c5 100644 (file)
@@ -327,6 +327,7 @@ PHP_INI_BEGIN()
        PHP_INI_ENTRY("precision",                                      "14",           PHP_INI_ALL,            OnSetPrecision)
        PHP_INI_ENTRY("sendmail_from",                          NULL,           PHP_INI_ALL,            NULL)
        PHP_INI_ENTRY("sendmail_path",  DEFAULT_SENDMAIL_PATH,  PHP_INI_SYSTEM,         NULL)
+       PHP_INI_ENTRY("mail_force_extra_parameters",NULL,               PHP_INI_SYSTEM,         NULL)
        PHP_INI_ENTRY("disable_functions",                      "",                     PHP_INI_SYSTEM,         NULL)
 
        STD_PHP_INI_BOOLEAN("allow_url_fopen",          "1",            PHP_INI_ALL,            OnUpdateBool,                   allow_url_fopen,                        php_core_globals,       core_globals)