Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove headers revealing system info when sending mail in php

I am using PHPs mail() function. I've noticed when going through the message (that gets sent) properties that some headers are present which specify

  • the filename which sent the email
  • which version of php I'm running
  • my OS info

I've removed the domain, but this is basically what's included. How can I stop this being included, or am I just being security paranoid? Also, I would like to keep using phps mail function as opposed to setting up something else. Thanks.

X-PHP-Originating-Script: 1000:emailtest.php
From: [email protected]
Reply-To: [email protected]
X-Mailer: PHP/5.3.10-1ubuntu3.10
Message-Id: <[email protected]>
like image 560
S.. Avatar asked Mar 15 '14 19:03

S..


1 Answers

Thanks @Wrikken for pointing me in the right direction

This article highlights two properties in php.ini that can be changed:

mail.add_x_header = Off
expose_php = Off

I have no idea why they'd be on by default..

like image 113
S.. Avatar answered Oct 10 '22 02:10

S..