mail() function modification

From: Date: Thu, 22 May 2003 22:20:56 +0000
Subject: mail() function modification
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1497@lists.php.net to get a copy of this message
I'd like modify the PHP mail() function to add the $_SERVER['SERVER_NAME'] into the header if it's available. It would be equivalent to adding a line into the headers argument from the PHP end that would be like: if ($_SERVER['SERVER_NAME']) { $headers .= '\nX-Originated-From: www.mywebsite.com'; } I see exactly in ext/standard/mail.c where I need to add this, but my problem is I'm not sure how to gain access to the $_SERVER super global array from the C API. Can anyone point me in the right direction? I don't see anything in the API docs that explains this, nor can I think of any PHP function that does something like this for a reference (except phpinfo(), but the code is unclear to me). I run a hosting company, and if any of our customers abuses this function, I want to be able to know from which website the mail originated. Thanks so much, Patrick

« previous php.smarty.dev (#1497) next »