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

Commitff54513

Browse files
committed
feature#42219 [Mailer] Add support of ping_threshold to SesTransportFactory (Tyraelqp)
This PR was squashed before being merged into the 5.4 branch.Discussion----------[Mailer] Add support of ping_threshold to SesTransportFactory| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | Yes| Deprecations? | no| Tickets |Fix#39044| License | MIT| Doc PR |symfony/symfony-docs#15557Added support of ping_threshold option to `SesTransportFactory` for `ses+smtp` and `ses+smtps` schemes. Needed because SES closes SMTP connection after 10 seconds of inactivity and `TransportException` will be thrown on next send: `Expected response code "250" but got code "451", with message "451 4.4.2 Timeout waiting for data from client.".`Commits-------2e50135 [Mailer] Add support of ping_threshold to SesTransportFactory
2 parentsa19735b +2e50135 commitff54513

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎src/Symfony/Component/Mailer/Bridge/Amazon/Tests/Transport/SesTransportFactoryTest.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ public function createProvider(): iterable
116116
newDsn('ses+smtps','default',self::USER,self::PASSWORD,null, ['region' =>'eu-west-1']),
117117
newSesSmtpTransport(self::USER,self::PASSWORD,'eu-west-1',$dispatcher,$logger),
118118
];
119+
120+
yield [
121+
newDsn('ses+smtps','default',self::USER,self::PASSWORD,null, ['region' =>'eu-west-1','ping_threshold' =>'10']),
122+
(newSesSmtpTransport(self::USER,self::PASSWORD,'eu-west-1',$dispatcher,$logger))->setPingThreshold(10),
123+
];
119124
}
120125

121126
publicfunctionunsupportedSchemeProvider():iterable

‎src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesTransportFactory.php‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ public function create(Dsn $dsn): TransportInterface
3030
$region =$dsn->getOption('region');
3131

3232
if ('ses+smtp' ===$scheme ||'ses+smtps' ===$scheme) {
33-
returnnewSesSmtpTransport($this->getUser($dsn),$this->getPassword($dsn),$region,$this->dispatcher,$this->logger);
33+
$transport =newSesSmtpTransport($this->getUser($dsn),$this->getPassword($dsn),$region,$this->dispatcher,$this->logger);
34+
35+
if (null !==$pingThreshold =$dsn->getOption('ping_threshold')) {
36+
$transport->setPingThreshold((int)$pingThreshold);
37+
}
38+
39+
return$transport;
3440
}
3541

3642
switch ($scheme) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp