• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved Return path in mail header when sending mail with PHP script

Thomas Becker

Basic Pleskian
Hello,
When a PHP script is sending a mail, there is added an return path in mail header. How to change that mail address in return path?

We are using Postfix and CentOS 6.5

Plesk is setting the mail address of the owner of the hosting account. When changing the owners mail address in Plesk, the return path is still the same and is not updated

Regards
Thomas
 
Hmmm..

Check the domain's php.ini (/var/www/vhosts/domain.tld/etc I think)

Code:
; For Win32 only.
; http://www.php.net/manual/en/mail.configuration.php#ini.sendmail-from
sendmail_from = [email protected]
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://www.php.net/manual/en/mail.configuration.php#ini.sendmail-path
sendmail_path = /usr/sbin/sendmail -t -i -f [email protected]

In the domain's php.ini, you'll see a section under [mail_function] with one or both of these which you can then edit (but ideally via the GUI as otherwise the setting may be overwritten).

Obviously the windows section is for windows, but I change both to be on the safe side :)
 
Hi Faris Raouf,
thanks for your response but there is no mail address specified in users php.ini nor in global php.ini:
sendmail_path = /usr/sbin/sendmail -t -i

'sendmail_from' is not set in both php.ini files.

Where does Plesk set the mail address used in return path in mail header?
 
Hi there
I am also looking to fix this Return-Path issue fixed on my server. When I send mass-mails from PHP, any bounces just get logged in maillog, but do not go to my email address (which is set in the domain owner). I specity a Return-Path in my mail headers, but this is ignored.
 
Hi PACh,

did you at least TRY to setup your depending PHP.INI as suggested by @Faris Raouf with his post => #2 ?
( pls. note, that domain - specific PHP.INI - files are located at "/var/www/vhosts/system/DOMAIN.COM-OR-SUBDOMAIN.DOMAIN.COM/etc"; additional modifications can as well being added over the Plesk Control Panel at "Home > Subscriptions > DOMAIN.COM > Websites & Domains > PHP Settings > (textbox) Additional directives" - Consider as well to modify the "mail.force_extra_parameters" - configuration ( available sind PHP 5 => http://php.net/manual/en/mail.configuration.php#ini.mail.force_extra_parameters ), as for example with "-f[email protected]" - where the "-f" is essential in front of your desired eMail - sender - adress!!! )
 
Back
Top