Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26947 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35669 invoked by uid 1010); 14 Dec 2006 03:31:44 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 35654 invoked from network); 14 Dec 2006 03:31:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Dec 2006 03:31:44 -0000 Authentication-Results: pb1.pair.com header.from=mike@fiddy8.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=mike@fiddy8.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain fiddy8.com from 64.26.176.17 cause and error) X-PHP-List-Original-Sender: mike@fiddy8.com X-Host-Fingerprint: 64.26.176.17 ottawa-hs-64-26-176-17.s-ip.magma.ca Linux 2.4/2.6 Received: from [64.26.176.17] ([64.26.176.17:37648] helo=box2.fiddy8.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3F/31-19506-555C0854 for ; Wed, 13 Dec 2006 22:31:09 -0500 Received: from mrobinson (mrobinson [192.168.1.3]) by box2.fiddy8.com (8.12.3/8.12.3/Debian-7.1) with ESMTP id kBE2rom9004950; Wed, 13 Dec 2006 21:54:00 -0500 To: "'Ilia Alshanetsky'" , "'PHP internals'" Date: Wed, 13 Dec 2006 21:53:50 -0500 Message-ID: <000001c71f2b$1e6aa9b0$0301a8c0@mrobinson> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 In-Reply-To: <10536315-883E-4C1A-AF35-386DF4D73F84@prohost.org> Thread-Index: AccfAS6QrnenIGIlSc214Dp5i92B5gAKYuog Subject: RE: [PHP-DEV] mail() logging for PHP From: mike@fiddy8.com ("Mike Robinson") References: <10536315-883E-4C1A-AF35-386DF4D73F84@prohost.org> 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