Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Settings Return-Path Email is not used #216

Open
2 tasks done
Filipe-Bicho opened this issue Aug 14, 2018 · 1 comment
Open
2 tasks done

Settings Return-Path Email is not used #216

Filipe-Bicho opened this issue Aug 14, 2018 · 1 comment

Comments

@Filipe-Bicho
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing.
  • 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 [email protected]' '-f [email protected]'";
It will use '[email protected]' as return path email.

Code to reproduce the issue

$sender = $message->getSender();
        if ($sender instanceof AddressInterface) {
            $parameters .= ' -f' . \escapeshellarg($sender->getEmail());
            return $parameters;
        }

        $from = $message->getFrom();
        if (count($from)) {
            $from->rewind();
            $sender      = $from->current();
            $parameters .= ' -f' . \escapeshellarg($sender->getEmail());
            return $parameters;
        }

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

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-mail; a new issue has been opened at laminas/laminas-mail#26.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants