Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26940 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 76729 invoked by uid 1010); 13 Dec 2006 21:52:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 76714 invoked from network); 13 Dec 2006 21:52:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Dec 2006 21:52:27 -0000 Authentication-Results: pb1.pair.com header.from=iliaal@gmail.com; sender-id=pass; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=iliaal@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.162.224 as permitted sender) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: iliaal@gmail.com X-Host-Fingerprint: 64.233.162.224 nz-out-0506.google.com Linux 2.4/2.6 Received: from [64.233.162.224] ([64.233.162.224:26119] helo=nz-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 21/58-19506-5D570854 for ; Wed, 13 Dec 2006 16:51:52 -0500 Received: by nz-out-0506.google.com with SMTP id k1so187870nzf for ; Wed, 13 Dec 2006 13:51:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:mime-version:content-transfer-encoding:message-id:content-type:to:from:subject:date:x-mailer:sender; b=LQVzyFbNVBQh8NLK95VIV0tgLGfqykMj8wSr6z+wtGkjHJl2i1mx3EqrZV1dgrqn1buXNnxT2y+udgvXko9ujLdM6nMHtQBq+CQFC+Oj8dmrVkwJXAW/HbXi7Fxkd0+hb1BhkztgSiiyTvhGuTHd9EusZ0LhqOBtXNJaMyM+xLA= Received: by 10.65.84.5 with SMTP id m5mr92006qbl.1166046674532; Wed, 13 Dec 2006 13:51:14 -0800 (PST) Received: from ?192.168.1.6? ( [74.108.69.82]) by mx.google.com with ESMTP id e15sm1507895qba.2006.12.13.13.51.13; Wed, 13 Dec 2006 13:51:13 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) Content-Transfer-Encoding: 7bit Message-ID: <10536315-883E-4C1A-AF35-386DF4D73F84@prohost.org> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: PHP internals Date: Wed, 13 Dec 2006 16:51:08 -0500 X-Mailer: Apple Mail (2.752.3) Sender: Ilia Alshanetsky Subject: mail() logging for PHP From: ilia@prohost.org (Ilia Alshanetsky) 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