ZF-11022: Setting resources.mail.transport.register = true causes an extra email to be sent to a bogus address.

Issue Type: Bug Created: 2011-02-02T21:32:49.000+0000 Last Updated: 2011-06-04T01:11:31.000+0000 Status: Resolved Fix version(s): - 1.11.8 (07/Jul/11)

Reporter: jsnod (afx114) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Application_Resource

  • Zend_Mail

Related issues: - ZF-9011

Attachments: - Zend_Application_Resource_Mail.diff


When using Zend_Mail_Transport_Sendmail via Zend_Application_Resouce_Mail and setting resources.mail.transport.register = true, I noticed a superfluous email being sent to a non-existent address in my mail logs:

<pre class="literal">Jan 30 04:30:14 myserver postfix/local[15519]: A97C84F52B: to=<>, orig_to=<1>, relay=local, 
delay=0.08, delays=0.03/0.02/0/0.03, dsn=5.1.1, status=bounced (unknown user: "1")
Jan 30 04:30:14 myserver postfix/local[15523]: B4DF24F547: to=<>, orig_to=<1>, relay=local, 
delay=0.02, delays=0/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "1")

The problem is that the 'register' value gets passed into Zend_Mail_Transport_Sendmail->__construct() as part of the $parameters array. For some reason, this causes an additional mail to be sent to This can be very costly when sending large amounts of email -- Postfix is having to work double for every email sent.

Another side-effect of this bug is that it breaks the fix added by ZF-9011, so you are unable to pass in an actual $parameters option to change sender envelope. Doing so results in the sending of yet another email to a bad address that looks like it comes from the specified envelope value, eg: So in this case, ZF is attempting to send three emails when it should only send one!

I have a patch to fix this and will attach, but I'm not sure if this is the best way to fix it.

For reference, here is my application.ini

<pre class="literal">
resources.mail.transport.type       = Zend_Mail_Transport_Sendmail
resources.mail.transport.register   = true    =     = "My Name" =  = "My Name"
resources.mail.transport.envelope   = "-f"


Posted by jsnod (afx114) on 2011-02-02T21:40:19.000+0000

Can't for the life of me find out how to upload a patch as an attachment, so here it is:

<pre class="literal">
Index: Zend/Application/Resource/Mail.php
--- Zend/Application/Resource/Mail.php  (revision 23688)
+++ Zend/Application/Resource/Mail.php  (working copy)
@@ -124,6 +124,7 @@
+        unset($options['register']);
         switch($transportName) {
             case 'Zend_Mail_Transport_Smtp':

Posted by BenoƮt Durand (intiilapa) on 2011-02-02T22:01:01.000+0000

To send a patch, you must sign the CLA before.

Posted by jsnod (afx114) on 2011-02-03T14:21:18.000+0000

patch attached

Posted by jsnod (afx114) on 2011-02-03T18:25:55.000+0000

Whoops, ignore that last attachment, I accidentally uploaded the wrong one. This is the proper patch.

Posted by jsnod (afx114) on 2011-04-11T19:35:49.000+0000

How can I get my patch reviewed for inclusion? I have to manually patch each point revision that comes out in order to fix this bug for my app.

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2011-06-04T01:10:46.000+0000

Fix committed in r24109. Merged with branch 1.11 in r24110.

Thanks for making ZF better.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.