MyBB Community Forums

Full Version: [F] Return-Path overruled by sendmail_from
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

Not 100% sure if this classifies as a bug because it is PHP behavior getting in the way. When sending an email (inc/functions.php) the header is calculated with a Return-Path entry set to the administrators email address. Cool.

Unfortunately when you set a sendmail_from setting in the php.ini this overrules this return-path in the header and sets it to whatever is in the sendmail_from. That by itself is fine where it not that I have no control over php.ini because this is setup by my provider, and the mail address they put in is of a mailserver that has no DNS MX-record. Certain mailservers (such as that of tiscali) will ignore any email coming from a mailserver that 'doesn't exist'.

The fix was easy enough, I added a:
ini_set("sendmail_from", $mybb->settings['adminemail']);

To the code that overrules the setting in the php.ini and makes sure mybboard does what its supposed to do.

So might be something that is worth actually adding to the product, or maybe trigger on a switch. It may solve some mail problems people may have.
Sounds like an okay fix/change. I'll ask Chris on this one though first.

Thanks
Ryan
Might btw be a good idea aswell to first to a ini_get and only set the value if it does not match the admin address. If I am not mistaken this is an ini setting mostly used for windows anyways.
Thank you for your bug report.

This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated.
Can you try this? Goes in inc/mailhandlers/php.php