Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Mailer] Do not ping the SMTP server before sending every message#35633

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:4.4frommicheh:ticket_35515
Feb 7, 2020
Merged

[Mailer] Do not ping the SMTP server before sending every message#35633

fabpot merged 1 commit intosymfony:4.4frommicheh:ticket_35515
Feb 7, 2020

Conversation

@micheh
Copy link
Contributor

QA
Branch?4.4
Bug fix?yes
New feature?no
Deprecations?no
TicketsFix#35515
LicenseMIT

This pull request changes the SMTP transport to only ping the server if the last message was sent more than a specified number of seconds ago (instead of pinging the server before every message). By default, it will ping the server if 100 or more seconds since the last message have passed.

This should make sending emails with the SMTP transport more robust with many emails, as SMTP servers will often drop the connection if too many non-mail commands are sent (like pinging the server with NOOP commands).

$this->executeCommand("\r\n.\r\n", [250]);
$message->appendDebug($this->stream->getDebug());

$this->lastSent =microtime(true);
Copy link
Member

Choose a reason for hiding this comment

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

You only update lastSent when a message has been sent. In case of an error, it won't be reset. By reading the issue, I would have expected that lastSent would be the last time we sent a ping.

Copy link
ContributorAuthor

@michehmichehFeb 7, 2020
edited
Loading

Choose a reason for hiding this comment

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

Yes, because the variable should represent the time when the last message was sent. I chose the name to be consistent with the parentAbstractTransport. Do you want me to change it?

Copy link
Member

Choose a reason for hiding this comment

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

But if sending the email does not work for some reason, you will ping the server next time you try, not sure if that's what we want.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

I don't have a strong opinion about this, so I changed it. I updated the name of the field as well, since it now has a slightly different meaning then the one in theAbstractTransport.

@nicolas-grekasnicolas-grekas added this to the4.4 milestoneFeb 7, 2020
@fabpot
Copy link
Member

Thank you@micheh.

fabpot added a commit that referenced this pull requestFeb 7, 2020
…message (micheh)This PR was squashed before being merged into the 4.4 branch (closes#35633).Discussion----------[Mailer] Do not ping the SMTP server before sending every message| Q             | A| ------------- | ---| Branch?       | 4.4| Bug fix?      | yes| New feature?  | no| Deprecations? | no| Tickets       |Fix#35515| License       | MITThis pull request changes the SMTP transport to only ping the server if the last message was sent more than a specified number of seconds ago (instead of pinging the server before every message). By default, it will ping the server if 100 or more seconds since the last message have passed.This should make sending emails with the SMTP transport more robust with many emails, as SMTP servers will often drop the connection if too many non-mail commands are sent (like pinging the server with NOOP commands).Commits-------2817810 [Mailer] Do not ping the SMTP server before sending every message
@fabpotfabpot merged commit2817810 intosymfony:4.4Feb 7, 2020
@michehmicheh deleted the ticket_35515 branchFebruary 7, 2020 17:04
This was referencedFeb 29, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@micheh@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp