To work around this notorious bug in Magento 2 where setting the return-path has no effect, we have made it possible to configure the return-path from the server side. While the Magento Community Engineering team is aware of this issue no canonical solution has been proposed yet. So in order to provide some relief we have made it possible to override the system return path in a way that will be kept across migrations between Hypernode plans. The setting is not configurable from the Hypernode userland but updating the default firstname.lastname@example.org return-path to something else can now be requested at support.
The problem is as follows. When you send a mail there will be a return-path. This path is used to send errors to when something goes wrong. For example if the email bounces, a non delivery receipt will be sent to that address. On Hypernode the default return path on the system is
email@example.com. But because this email address may be recognised as a spam address by spam filters, as it is a very generic email used on all Hypernodes without a sane email configuration, you normally would want to override this with something else like
firstname.lastname@example.org. To do so, there is a menu in the Magento 2 backend that allows you to manage the return-path email address. Unfortunately, in some versions of Magento 2 it does not work. The setting is ignored and the system’s return path is used anyway.
For the exact technical details see this comment by Danny Verkade. In order to work around this we can change the system default to the return-address that is actually desired. To achieve this we set the sendmail_path in the
php.ini. This setting can not be set as part of user scripts or on a per-directory basis using the .user.ini file, which is why we have to manage it centrally.
You can inspect if this override is active on your node by checking the
php -i output:
# Override set, return-path will be email@example.com
root@abc1de-vdloo-magweb-do /data/web/public/var/log # php -i | grep sendmail | grep Path
Path to sendmail => /usr/sbin/sendmail -t -i -firstname.lastname@example.org
# No override set, return-path will be email@example.com
root@abc1de-vdloo-magweb-do ~ # php -i | grep sendmail | grep path
root@abc1de-vdloo-magweb-do ~ #
You can override these settings according to our documentation