Zend Framework

setReturnPath overwrites setFrom in Zend_Mail_Protocol_Smtp

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.7.8, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5
  • Fix Version/s: 1.9.6
  • Component/s: Zend_Mail
  • Labels:
    None

Description

$mail = new Zend_Mail();
$mail->setFrom('sender@email.com');
$mail->setReturnPath('returns@email.com');
$mail->send( .. Zend_Mail_Transport_Smtp .. );

E-mail is being sent on returns@email.com instead of sender@email.com;

Zend_Mail_Transport_Smtp, line 203:
$this->_connection->mail($this->_mail->getReturnPath());

Please fix.

Issue Links

Activity

Hide
Satoru Yoshida added a comment -

Hi, Marcin.

Do you mean you find mail returns back when some error is happened?
Or, you find [from] address is changed on your mailer?

Show
Satoru Yoshida added a comment - Hi, Marcin. Do you mean you find mail returns back when some error is happened? Or, you find [from] address is changed on your mailer?
Hide
Marcin Gil added a comment -

Hi Satoru,

I mean that e-mail is sent from "returns@email.com" instead of "sender@email.com".
I understand that e-mail should be sent from "sender@email.com" with Return-Path header set to "returns@email.com" - in case of error.
Do I understand incorrectly?

Cheers,
Marcin

Show
Marcin Gil added a comment - Hi Satoru, I mean that e-mail is sent from "returns@email.com" instead of "sender@email.com". I understand that e-mail should be sent from "sender@email.com" with Return-Path header set to "returns@email.com" - in case of error. Do I understand incorrectly? Cheers, Marcin
Hide
Satoru Yoshida added a comment -

I change code in SVN r18988 (trunk), 18989 (1.9 branch) .

You are correct, Marcin.
For your purpose, getReturnPath() should be replaced with getFrom().

And I have a sadly information I must notice you
As it is pointed out in ZF-7008, setReturnPath can not work fine now.

The function is under consideration how to fix.

Show
Satoru Yoshida added a comment - I change code in SVN r18988 (trunk), 18989 (1.9 branch) . You are correct, Marcin. For your purpose, getReturnPath() should be replaced with getFrom(). And I have a sadly information I must notice you As it is pointed out in ZF-7008, setReturnPath can not work fine now. The function is under consideration how to fix.
Hide
Janis Lünne added a comment -

Hi Satoru, hi Marcin,

unfortunately this is broken now.
The Return-Path has to be used as MAIL FROM: in the SMTP transport.
So please undo your replacement of getReturnPath() with getFrom(), because it was working correctly before.

Thanks,
Janis

Show
Janis Lünne added a comment - Hi Satoru, hi Marcin, unfortunately this is broken now. The Return-Path has to be used as MAIL FROM: in the SMTP transport. So please undo your replacement of getReturnPath() with getFrom(), because it was working correctly before. Thanks, Janis
Hide
Dolf Schimmel (Freeaqingme) added a comment -

Please present some code to reproduce, and describe the problem with that code. Thanks.

Show
Dolf Schimmel (Freeaqingme) added a comment - Please present some code to reproduce, and describe the problem with that code. Thanks.
Hide
Janis Lünne added a comment -

Zend_Mail_Transport_Smtp, line 203:
was (correct):
$this->_connection->mail($this->_mail->getReturnPath());
is now (incorrect):
$this->_connection->mail($this->_mail->getFrom());

This results in always using the "Body-From" (From:-Header), as "Envelope-From" ("MAIL FROM:" SMTP command) and removes the possibility to use different Envelope-From and Body-From Addresses.

See RFC 2821 and http://en.wikipedia.org/wiki/Bounce_address for reference.

Show
Janis Lünne added a comment - Zend_Mail_Transport_Smtp, line 203: was (correct): $this->_connection->mail($this->_mail->getReturnPath()); is now (incorrect): $this->_connection->mail($this->_mail->getFrom()); This results in always using the "Body-From" (From:-Header), as "Envelope-From" ("MAIL FROM:" SMTP command) and removes the possibility to use different Envelope-From and Body-From Addresses. See RFC 2821 and http://en.wikipedia.org/wiki/Bounce_address for reference.
Hide
Dolf Schimmel (Freeaqingme) added a comment -

Ouch. Will fix tonight.

Show
Dolf Schimmel (Freeaqingme) added a comment - Ouch. Will fix tonight.
Hide
Stephan Wentz added a comment -

bump

It's still not fixed in trunk - and it breaks our mail code

Show
Stephan Wentz added a comment - bump It's still not fixed in trunk - and it breaks our mail code
Hide
Marc Hodgins added a comment -

ZF-8988 was opened because this was not actually a bug and the "solution" broke Zend_Mail to not be compliant with the RFC with the SMTP transport.

Closing this issue to avoid confusion – see ZF-8988 for the fix.

Show
Marc Hodgins added a comment - ZF-8988 was opened because this was not actually a bug and the "solution" broke Zend_Mail to not be compliant with the RFC with the SMTP transport. Closing this issue to avoid confusion – see ZF-8988 for the fix.

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: