diff options
author | Derick Rethans <derick@php.net> | 2003-02-26 20:04:16 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2003-02-26 20:04:16 +0000 |
commit | 424c41a72e0521cbaee9ffa2e5188316843699d7 (patch) | |
tree | 9496da08e789b5694c7097b0fc26a2c49662164c | |
parent | 17acc55ad0a3aeacb350fae608b86b712c7fa9cf (diff) | |
download | php-git-424c41a72e0521cbaee9ffa2e5188316843699d7.tar.gz |
- Added an extra ini setting with which extra commands can be forced to
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)
-rw-r--r-- | ext/standard/mail.c | 5 | ||||
-rw-r--r-- | main/main.c | 1 |
2 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/mail.c b/ext/standard/mail.c index 3dd51cb3df..6b4f701734 100644 --- a/ext/standard/mail.c +++ b/ext/standard/mail.c @@ -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); } diff --git a/main/main.c b/main/main.c index cc61d9486f..c9e36152dd 100644 --- a/main/main.c +++ b/main/main.c @@ -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) |