ZF-11022: Setting resources.mail.transport.register = true causes an extra email to be sent to a bogus address.
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:
Jan 30 04:30:14 myserver postfix/local: A97C84F52B: to=<email@example.com>, 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: B4DF24F547: to=<firstname.lastname@example.org>, 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 email@example.com. 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: -firstname.lastname@example.org. 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
resources.mail.transport.type = Zend_Mail_Transport_Sendmail resources.mail.transport.register = true resources.mail.defaultFrom.email = email@example.com resources.mail.defaultFrom.name = "My Name" resources.mail.defaultReplyTo.email = firstname.lastname@example.org resources.mail.defaultReplyTo.name = "My Name" resources.mail.transport.envelope = "-f email@example.com"