Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1948 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35508 invoked from network); 23 May 2003 19:51:38 -0000 Received: from unknown (HELO strongbad.retrix.com) (64.69.86.68) by pb1.pair.com with SMTP; 23 May 2003 19:51:38 -0000 Received: from [24.68.26.237] (dankwell.patrickg.com [24.68.26.237]) (authenticated bits=0) by strongbad.retrix.com (8.12.6p2/8.12.3) with ESMTP id h4NJs3UY039911 for ; Fri, 23 May 2003 12:54:03 -0700 (PDT) (envelope-from php.dev@patrickg.com) User-Agent: Microsoft-Entourage/10.1.1.2418 Date: Fri, 23 May 2003 12:51:34 -0700 To: Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Subject: Update to mail() function help From: php.dev@patrickg.com (Patrick Gibson) 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. When there are hundreds of virtual hosts, something like this would make it really helpful at times. Thanks so much, Patrick