when I SetReturnPath in zend framework v1 my email has 2 return-path headers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

when I SetReturnPath in zend framework v1 my email has 2 return-path headers

jasonhendriks
I found this message which says "This post has NOT been accepted by the mailing list yet." so I figured I better start a new thread. I've had reports of errors from users where servers fail to accept a message when the Return-Path header is already set. (Then why call mail->setReturnPath() at all you ask? Zend_Mail v1 overrides the 'From' email with this value for MAIL-FROM in the envelope, allowing a different email for the message Sender header) According to RFC 5321, MUA's should not set Return-Path headers in the SMTP message: "A message-originating SMTP system SHOULD NOT send a message that already contains a Return-path header field." I fixed this by removing this line in setReturnPath($email) of class Zend_Mail (Zend/Mail.php) : $this->_storeHeader('Return-Path', $email, false); The Gmail MSA/MTA (and possibly others) always appends their own Return-Path regardless of what Zend does resulting in a duplicate header : Return-Path: <test@hendriks.ca> Return-Path: test@hendriks.ca Am I breaking something in Zend with my change? I believe it's correct.