Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 406093

Summary: dev-lang/php: feature to add an informational header to messages sent from PHP via mail()
Product: Gentoo Linux Reporter: Gerald <newsgroup.spam>
Component: New packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: mjo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://choon.net/php-mail-header.php
Whiteboard:
Package list:
Runtime testing required: ---

Description Gerald 2012-02-27 23:02:00 UTC
http://choon.net/php-mail-header.php
has been offering patches for PHP that add an extra line to the email header of mails sent using php's mail() function.

This is highly desirable in hosting environments where it is extremely hard to track down what php script has been exploited when you once again notice that your mail servers outgoing queue contains a hundred thousand spam messages that came from apache (and you have no clue what website and what script was exploited).

This patch solves all this by adding a simple header like:
X-PHP-Script: www.example.com/~user/testapp/send-mail.php for 10.0.0.1

It would be a really nice feature to have. The patch is available for pretty much all versions of PHP on the site (see url in bug description) and seems benign enough :)

This is the patch for PHP 5.3.x:
http://choon.net/opensource/php/php-5.3.x-mail-header.patch

If this could be added as an option (use flag) in the ebuild I would guess that it would make the lives of many web admins a lot easier :-)


Reproducible: Always
Comment 1 Michael Orlitzky gentoo-dev 2012-02-28 02:50:14 UTC
This shouldn't be needed any more (thank god):

  http://www.php.net/manual/en/mail.configuration.php#ini.mail.log
Comment 2 Ole Markus With (RETIRED) gentoo-dev 2012-02-28 13:36:39 UTC
Pretty much the same as bug 290004

*** This bug has been marked as a duplicate of bug 290004 ***