How to remove headers that reveal system information when sending mail in php

I am using the mails () function of PHPs. I noticed that when viewing messages (which are sent) properties that are present in some headers that indicate

  • name of the file that sent the email
  • what version of php am i running
  • information about my OS

I deleted the domain, but this is basically what is included. How can I stop this inclusion, or am I just paranoid about security? In addition, I would like to continue to use the phps mail function, and not configure anything else. Thank.

X-PHP-Originating-Script: 1000:emailtest.php
From: hidden@hidden.hh
Reply-To: hidden@hidden.hh
X-Mailer: PHP/5.3.10-1ubuntu3.10
Message-Id: <20140315193810.ADD43120489@hidden.hh>
+7
source share
3 answers

Thanks @Wrikken for pointing me in the right direction

php.ini, :

mail.add_x_header = Off
expose_php = Off

, ..

+14

, , GitHub X-Mailer .

$mail = new PHPMailer(true);
$mail->XMailer = ' ';
0

Source: https://habr.com/ru/post/1531955/


All Articles