derick          Wed Feb 26 15:04:17 2003 EDT

  Modified files:              
    /php4/ext/standard  mail.c 
    /php4/main  main.c 
  Log:
  - 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)
  
  
Index: php4/ext/standard/mail.c
diff -u php4/ext/standard/mail.c:1.69 php4/ext/standard/mail.c:1.70
--- php4/ext/standard/mail.c:1.69       Mon Feb 24 14:41:18 2003
+++ php4/ext/standard/mail.c    Wed Feb 26 15:04:15 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mail.c,v 1.69 2003/02/24 19:41:18 iliaa Exp $ */
+/* $Id: mail.c,v 1.70 2003/02/26 20:04:15 derick Exp $ */
 
 #include <stdlib.h>
 #include <ctype.h>
@@ -86,6 +86,7 @@
        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 @@
                }
        }
 
-       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: php4/main/main.c
diff -u php4/main/main.c:1.528 php4/main/main.c:1.529
--- php4/main/main.c:1.528      Wed Feb 19 11:17:15 2003
+++ php4/main/main.c    Wed Feb 26 15:04:16 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.528 2003/02/19 16:17:15 phanto Exp $ */
+/* $Id: main.c,v 1.529 2003/02/26 20:04:16 derick Exp $ */
 
 /* {{{ includes
  */
@@ -327,6 +327,7 @@
        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)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to