Fixed Symfony TransportException: Email failed: Expected response code "250" but got code "451", with message "451", with message "451 4.4.2 Timeout

Alpha1

Well-known member
Licensed customer
Affected version
2.3.10
I have loads of the following errors. I had these on the previous server and now on ultrafast server these keep coming. AWS SES sending rate limits have been royally increased, so its not that.

Symfony\Component\Mailer\Exception\TransportException: Email to xxx@gmail.com from xxx@forum.com failed: Expected response code "250" but got code "451", with message "451 4.4.2 Timeout waiting for data from client.".
  • src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php:307
  • Generated by: Unknown account
    May 12, 2026 at 1:00 PM

#0 src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(182): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->assertResponseCode('451 4.4.2 Timeo...', Array)
#1 src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(235): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->executeCommand('MAIL FROM:<xxx...', Array)
#2 src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(199): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->doMailFromCommand('xxx@...')
#3 src/vendor/symfony/mailer/Transport/AbstractTransport.php(72): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->doSend(Object(Symfony\Component\Mailer\SentMessage))
#4 src/vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php(136): Symfony\Component\Mailer\Transport\AbstractTransport->send(Object(Symfony\Component\Mailer\SentMessage), Object(Symfony\Component\Mailer\DelayedEnvelope))
#5 src/XF/Mail/Mailer.php(470): Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->send(Object(Symfony\Component\Mime\Email))
#6 src/addons/DBTech/Mail/XF/Mail/Mailer.php(60): XF\Mail\Mailer->send(Object(Symfony\Component\Mime\Email), Object(Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport))
#7 src/addons/DigitalPoint/Analytics/XF/Mail/Mailer.php(113): DBTech\Mail\XF\Mail\Mailer->send(Object(Symfony\Component\Mime\Email), NULL)
#8 src/XF/Job/MailSend.php(37): DigitalPoint\Analytics\XF\Mail\Mailer->send(Object(Symfony\Component\Mime\Email))
#9 src/addons/DBTech/Mail/XF/Job/MailSend.php(26): XF\Job\MailSend->run(44.7112)
#10 src/XF/Job/Manager.php(275): DBTech\Mail\XF\Job\MailSend->run(44.7112)
#11 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 44.7112)
#12 src/XF/Job/Manager.php(89): XF\Job\Manager->runJobEntry(Array, 44.7112)
#13 src/XF/Cli/Command/RunJobs.php(58): XF\Job\Manager->runQueue(false, 45)
#14 src/vendor/symfony/console/Command/Command.php(298): XF\Cli\Command\RunJobs->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 src/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 src/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\RunJobs), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 src/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 src/XF/Cli/Runner.php(115): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 cmd.php(17): XF\Cli\Runner->run()
#20 {main}

array(1) {
["cli"] => string(62) "/cmd.php xf:run-jobs"
}

Similar bug report here which seems to have lead to the switch to Symphony:
Some related information:
This seems to suggest that xenforo connection through Symfony mail goes idle, leading to this error.
 
We've started having this come up in pretty much a constant stream after upgrading a client's site to XF 2.3.10 from 2.2.x, also using Amazon SES
 
Last edited:
Have applied this patch that seems to address the issue, so far:


Diff:
diff --git a/src/XF/Mail/Mailer.php b/src/XF/Mail/Mailer.php
index a058c9dbb2..b13b4bb47a 100644
--- a/src/XF/Mail/Mailer.php
+++ b/src/XF/Mail/Mailer.php
@@ -561,6 +561,11 @@ class Mailer
                     $stream->disableTls();
                 }
 
+                $pingThreshold = (int) (\XF::app()->config('smtpKeepAlivePingThreshold') ?: 5);
+                if ($pingThreshold > 0) {
+                    $transport->setPingThreshold($pingThreshold);
+                }
+
                 return $transport;
 
             case 'file':

Defaults to 5 seconds, but can be adjusted with:

PHP:
$config['smtpKeepAlivePingThreshold'] = 30;

have attached an add-on as well that does the same thing without manual code changes in case this never gets patched for some reason.

Edit: 4 hours later, nothing logged still, prior to this patch it was being logged every minute or so
 

Attachments

Last edited:
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.11).

Change log:
Ping idle SMTP keep-alive connections before sending to avoid 451 timeout errors
There may be a delay before changes are rolled out to the XenForo Community.
 
Thanks a lot @Jake B.!

The add-on (prior to upgrading to XF 2.3.11) fixed a similar issue for me:

 
Back
Top Bottom