Details
Description
File: /Zend/Mail/Transport/Smtp.php
Line: 207
In the smtp transport the from address is set with the following function:
// Set sender email address
$this->_connection->mail($this->_mail->getFrom());
When sending a mail to an unknown user with a valid host. In most cased the headers will be read and the Return-Path header will be used to return the mail.
When sending a mail to a non-existing host. The smtp server will return the mail to the from address given in the smpt transport. The header has not been read.
In my opinion the sender email address must be set with the following function, so the bounce addresses goes to the return path.
// Set sender email address
$this->_connection->mail($this->_mail->getReturnPath());
Which automatically fallback in the from address if return path is not set.
Funny that this was created yesterday. I recently had the same problem on a project I am working on. This should really be as simple as changing the function that is called. Hope that this fix can be included in the next mini release.