RE: [PHP-DEV] mail() logging for PHP
| From: | Mike Robinson | Date: | Thu, 14 Dec 2006 02:53:50 +0000 |
| Subject: | RE: [PHP-DEV] mail() logging for PHP | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26947@lists.php.net to get a copy of this message | ||
Ilia Alshanetsky writes:
> Is there any interest in adding support for logging of mail()
> calls and/or adding options that allow identification of who
> sent the e-mail.
>
> I've wrote a quick patch that enables this functionality via
> two ini settings controllable via php.ini or per-virtual host.
>
> The first option, mail.add_x_header (boolean) allows you to
> enable the addition of the X-PHP-Originating-Script header to
> each mail sent by mail(), which will include the uid of the
> script and its name. The combination of the two should be
> sufficient to identify the user to whom the script belongs
> and via a simple find command locate the actual script. This
> option is intended primarily for instances where you have a
> bounced e-mail or a forwarded mail with a spam complaint,
> allowing you to quickly identify the offender.
>
> The second option, mail.log (takes a filename) allows you to
> enable logging of every single mail() call, each log line
> will include the fullpath of the file and the line where the
> mail() was called from in addition to the "To" address and
> any headers (to keep track of CC,
> BCC) that were part of the function call. To ensure that each
> log line is 1 line long, \r and \n are replaced with spaces.
>
> The patch that makes this possible can be found here:
>
> http://ilia.ws/uploads/patches/mail_log.txt.gz
>
> Ilia Alshanetsky
A fabulous addition. How fast can this make it into PHP? 5.2.1? 8-)
Best,
Mike Robinson