• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Changes to php.ini, mail.add_x_header and sendmail_from

iainh

Basic Pleskian
I am migrating from Plesk 8 to 12 on CentOS 6 and still trying to iron out a few issues.

Currently I'm looking at two php-sent mail issues.

Issue 1: X-PHP-Originating-Script header has appeared in mail sent by new vhost

Mail sent from the new box includes the X-PHP-Originating-Script header which is a bit of a security hole, hence I'd like to remove/suproess this. The php documentation (http://php.net/manual/en/mail.configuration.php) says:
mail.add_x_header bool
Add X-PHP-Originating-Script that will include UID of the script followed by the filename.
The php.ini for the particular site (/var/www/vhosts/system/domain.tld/etc/php.ini) includes mail.add_x_header = On and so I would seem to need to alter this to read = 0 or = Off, however the php.ini file starts...

; ATTENTION!
;
; DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
; SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

So how then would I make this change and not have it lost, or would it only be loast at a php update and so 'reasonably safe' to change?​

Issue 2: SMTP Return-Path header overridden

The sending php script sets a suitable Return-Path header value, but on the new vhost this is being overridden and replaced with <[email protected]>. I suspect too that this name is also being used as the SMTP HELO name during mail sending. This will then mean a DMARC check will note the MailFrom and Sender domains are different and so I'd really like to stop this behaviour.

Again the php documentation points to:
sendmail_from string
Which "From:" mail address should be used in mail sent from PHP under Windows. This directive also sets the "Return-Path:" head
I am *presuming* this value will also be used as the SMTP HELO name, but if someone knows this one way or another of how to correctly set the HELO name, I'd be very grateful.

Now the php.ini doesn't include the sendmail_from setting at all which is probably why it's defaulting to the <[email protected]> name, but again, how can I add this and not have the configration lost as per the warning in php.ini?​

And finally...

I mentioned there is a php.ini for each vhost saved in /var/www/vhosts/system/domain.tld/etc/php.ini. Am I correct in beleiving that once I've confirmed how to make these proposed php.ini changes 'safely', I can set these appropriate to each vhost so that mail sent from each site can be correctly sent under the appropriate domain name and not under the physical host name?​

Many thanks.../Iain
 
Back
Top