Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: close smtp connection after sending or on error #9561

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Apr 12, 2024

Unfortunately, getSMTPObject() creates a connection if it's not already established. Ideally, the connection is already established due to the send command some lines above so we only close it. There is no way around it because the wrapped SMTP object is private.

@st3iny st3iny requested a review from miaulalala April 12, 2024 11:41
@st3iny st3iny self-assigned this Apr 12, 2024
@st3iny st3iny requested a review from ChristophWurst as a code owner April 12, 2024 11:41
@st3iny st3iny force-pushed the fix/close-smtp-connection branch from 665facd to 14a7362 Compare April 12, 2024 11:43
lib/SMTP/SmtpClientFactory.php Outdated Show resolved Hide resolved
lib/Service/MailTransmission.php Outdated Show resolved Hide resolved
Unfortunately, `getSMTPObject()` creates a connection if it's not
already established. Ideally, the connection is already established due
to the send command some lines above so we only close it. There is no
way around it because the wrapped SMTP object is private.

Signed-off-by: Richard Steinmetz <[email protected]>
@st3iny st3iny force-pushed the fix/close-smtp-connection branch from 14a7362 to 8f9a89b Compare April 15, 2024 09:11
@st3iny st3iny requested a review from miaulalala April 15, 2024 09:11
Copy link
Contributor

@miaulalala miaulalala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@st3iny st3iny added this to the v3.8.0 milestone Jun 25, 2024
@st3iny st3iny merged commit 3b879b4 into main Jun 25, 2024
35 checks passed
@st3iny st3iny deleted the fix/close-smtp-connection branch June 25, 2024 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants