English  France













If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.



Reply
  #1 (permalink)  
Old 05-01-2009, 05:17 AM
UnderHost's Avatar
UnderHost Management
 
Join Date: Jul 2008
Posts: 581
Default Track what PHP script sent an email on your cPanel server?

There is a patch available from choon.net which forces PHP scripts to store the script name and location in the mail headers when using the mail() function. The below instructions will give you the details needed to add this patch to your cPanel server:
  1. Log into the server as root via ssh or the console.
  2. Run
    PHP Code:
    mkdir -/var/cpanel/buildapache/scripts 
  3. Create a file called phppost using a text editor vi phppost
  4. Add the following lines:

    PHP Code:
    #AUTO PATCH FROM http://choon.net/php-mail-header.php
    PHPVER=`find -type d -iname "php-*"|sed "s/.///g"`
    wget http://choon.net/opensource/php/$PHPVER-mail-header.patch
    patch -p0 $PHPVER-mail-header.patch 
  5. Save and quit that file.
  6. Run
    PHP Code:
    /scripts/easyapache 
    and now the patch will be automatically applied.
When you receive spam complaints you will now be able to look at the headers of the message and view what script and site these came from. This is extremely useful because PHP runs as nobody unless phpsuexec is enabled and in a virtual environment it can be difficult trying to track down the broken script!
__________________
UnderHostProviding Affordable and Quality USA Hosting & Offshore cPanel Hosting
24/7 Rapid Support / 99.9% Uptime Guarantee / Shared / Reseller / VPS / Dedicated
Premium VPSUSA Cloud Virtual Private Servers - Dedicated and Scalable Resources - Parallels® Virtuozzo
Hong Kong - Singapore - USA - Canada - Netherlands - UK - Germany - Panama - Malaysia
Reply With Quote
underhost.us
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Loading...


All times are GMT -4. The time now is 02:09 AM.
Copyright © 2010 UnderHost Networks Ltd






Partners
Underhost Facebook  Underhost Twitter

Copyright © 2011 UnderHost Networks Ltd