[x] I was not able to find an open or closed issue matching what I'm seeing.
[x] This is not a question. (Questions should be asked on chat (Signup here) or our forums.)
Return-Path Email is not used because the php function mail($to, $subject, $message, $headers, $parameters) only uses the last forced email from the $parameters string and the method prepareParameters(Mail\Message $message) in the class zend-mail\src\Transport\Sendmail.php
adds a second forced parameter, so the mail() function only uses this second parameter and the desired return path email is ignored.
E.g. $parameters = " '-f test1@mail.com' '-f test2@mail.com'";
It will use 'test2@mail.com' as return path email.
1 - Admin store: Stores > Settings > Configuration > Advanced > System > Mail Sending Settings > Return-Path Email - set a different return path email
2 - Place an order
3 - Look for ´Return-Path: ' in the email
Return-Path Email is not used because the php function mail($to, $subject, $message, $headers, $parameters) only uses the last forced email from the $parameters string and the method prepareParameters(Mail\Message $message) in the class zend-mail\src\Transport\Sendmail.php adds a second forced parameter, so the mail() function only uses this second parameter and the desired return path email is ignored.
E.g. $parameters = " '-f test1@mail.com' '-f test2@mail.com'"; It will use 'test2@mail.com' as return path email.
Code to reproduce the issue
Magento 2.3.0 Alpha: steps to reproduce
1 - Admin store: Stores > Settings > Configuration > Advanced > System > Mail Sending Settings > Return-Path Email - set a different return path email 2 - Place an order 3 - Look for ´Return-Path:' in the email
Expected results
return path email saved in settings
Actual results
sender or from email