This repository was archived by the owner on Jan 8, 2020. It is now read-only.
Zend\Mail SMTP Fix Connection Handling#3561
Merged
weierophinney merged 1 commit intoJan 26, 2013
Merged
Conversation
…ating the connection
weierophinney
added a commit
that referenced
this pull request
Jan 26, 2013
weierophinney
added a commit
to zendframework/zend-mail
that referenced
this pull request
May 14, 2015
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Zend\Mail contains some issues for connection handling; generally most people will not run into this unless they utilize the SMTP transport in say a worker from a message queue. Take the scenario of your worker runs out of work and disconnects from the SMTP server; if you go to send the mail again (without manually handling all connection semantics) it will fail. Further, there is a bug where it attempts to lazily load the connection but if there is already a connection object it doesn't check the state.
Changes
There are no BC breaks
The unit test asset for the SMTP protocol spy was not in good shape itself; it did not properly call many methods that it was extending from. A new method is in the Smtp protocol called hasSession which contains the variable from our start session and stop session code.
Additionally the Smtp transport now checks for the existence of the connection object and the new hasSession status. The code has been slightly refactored to keep BC but also to keep code duplication down.