Page 1 of 1

Getting rid of X-headers in PHP's mail() function?

Posted: Tue Jun 07, 2011 4:37 am
by Apollo
On one of my webservers, every email I send using PHP's mail() function contains some additional headers, such as X-AntiAbuse and X-PHP-Script, like this:

Code: Select all

X-PHP-Script: www.example.com/cms/admin/contact.php for 69.195.136.109
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Originator/Caller UID/GID - [420 33605] / [26 6]
X-AntiAbuse: (...more stuff...)
X-Source-Args: /usr/bin/php /home/apollo/public_html/cms/admin/contact.php 
etc...
I'd like to get rid of those. Have been in touch with the hosting provider to disable these headers, but they don't know (it's a semi self-managed dedicated server). I also looked through all /etc/exim.* config files but couldn't find anything there either.

I assume this must be some PHP setting or sendmail configuration or whatever, but I have no clue how/what/where... Anyone? :?:

FYI: this particular server is running CentOS 5.5, linux kernel 2.6.18, PHP 5.2.17.

Re: Getting rid of X-headers in PHP's mail() function?

Posted: Tue Jun 07, 2011 11:25 am
by Celauran

Re: Getting rid of X-headers in PHP's mail() function?

Posted: Thu Jun 09, 2011 5:46 am
by Apollo
Celauran wrote:Seen this?
I did now - seems like just what I need, thanks mate!

Re: Getting rid of X-headers in PHP's mail() function?

Posted: Tue Jun 14, 2011 5:27 am
by Apollo
hmm, actually, that seemed to be not all there is to it.

Disabling the headers_add thingy (so the 'mailtrapheaders' perl function no longer gets called) causes the X-AntiAbuse and X-Source-Args stuff to be no longer included. That's good.

However emails I send using PHP's mail() function still contain the X-PHP-Script: header (which reveals the internal script name and the visitor's IP). Does anyone know how to get rid of that as well?

Re: Getting rid of X-headers in PHP's mail() function?

Posted: Tue Jun 14, 2011 8:55 am
by Apollo
Small addition - this "patch" seems to be the cause of the problem: http://www.lancs.ac.uk/~steveb/patches/ ... der-patch/

Anyone familiar with that? And do you know how to check if this is in my system as well, or how to disable it?