• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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