XF 2.2 Swift_TransportException

FloV

Well-known member
Hi,

i've got a lot (!) of errors like this in my error log:

Server-Fehlerprotokoll
  • Swift_TransportException: Email to xxx@mac.com failed: Expected response code 250 but got code "451", with message "451 4.4.2 Timeout waiting for data from client. "
  • src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:459
  • Generiert von: Unbekanntes Konto
  • 18 August 2021 um 16:50
I'm sending my mails through Amazon SES on Port 25. A lot of mails are going through, but some doesn't. Do you know what's causing these errors?

Thanks in advance

Florian
 
Some googling seems to indicate that this is a problem with the SMTP transport specifically when sending to Amazon SES.

I think this is something that the XF devs will need to look at - I suspect it might be a Swiftmailer bug / gotcha with SES.
 
I believe other customers are using SES without issue so not entirely sure how much help we can be.

I’ve seen reference to Amazon SES rate limits when this error is mentioned so I would check to ensure you’re within those. That would be consistent with the intermittent nature of it.
 
Hmm, that doesn't seem the case:

1631094389420.webp

Everything in the SES Console looks fine, but i got around 45 errors in XenForo in the last hour.

I got around 10 of this errors (with different mail addresses):

Code:
ErrorException: Email to xxx@xxx.de failed: [E_WARNING] fwrite(): SSL: Broken pipe src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:223
Generiert von: Unbekanntes Konto 8 September 2021 um 10:38
Stack-Trace
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] fwr...', '/var/www/share/...', 223, Array)
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(223): fwrite(Resource id #655, 'QUIT
MAIL FROM...')
#2 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php(168): Swift_Transport_StreamBuffer->doCommit('QUIT
MAIL FROM...')
#3 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php(91): Swift_ByteStream_AbstractFilterableInputStream->doWrite('QUIT
MAIL FROM...')
#4 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(327): Swift_ByteStream_AbstractFilterableInputStream->write('MAIL FROM:<kont...')
#5 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(305): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM:<kont...', Array, Array, true, NULL)
#6 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(386): Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM:<kont...', Array, Array, true)
#7 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(485): Swift_Transport_EsmtpTransport->doMailFromCommand('kontakt@planet-...')
#8 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(518): Swift_Transport_AbstractSmtpTransport->doMailTransaction(Object(Swift_Message), 'kontakt@planet-...', Array, Array)
#9 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(206): Swift_Transport_AbstractSmtpTransport->sendTo(Object(Swift_Message), 'kontakt@planet-...', Array, Array)
#10 src/XF/Mail/Mailer.php(304): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#11 src/XF/Mail/Queue.php(138): XF\Mail\Mailer->send(Object(Swift_Message), Object(XF\Mail\SmtpTransport), Array)
#12 src/XF/Job/MailQueue.php(12): XF\Mail\Queue->run(7.33976)
#13 src/XF/Job/Manager.php(258): XF\Job\MailQueue->run(7.33976)
#14 src/addons/SV/CachePermissionChecks/XF/Job/Manager.php(17): XF\Job\Manager->runJobInternal(Array, 7.33976)
#15 src/XF/Job/Manager.php(200): SV\CachePermissionChecks\XF\Job\Manager->runJobInternal(Array, 7.33976)
#16 src/XF/Job/Manager.php(84): XF\Job\Manager->runJobEntry(Array, 7.33976)
#17 src/XF/Cli/Command/RunJobs.php(59): XF\Job\Manager->runQueue(false, 8)
#18 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\RunJobs->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 src/vendor/symfony/console/Application.php(992): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 src/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\RunJobs), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 src/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#22 src/XF/Cli/Runner.php(109): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 cmd.php(15): XF\Cli\Runner->run()
#24 {main}
Status der Anfrage
array(1) {
  ["cli"] => string(66) "/var/www/share/mydomain.com/htdocs/cmd.php --quiet xf:run-jobs"
}

And a lot more of this errors (sometimes same and sometimes different mail addresses):

Code:
Swift_TransportException: Email to xxx@xxx.de failed: Expected response code 250 but got code "451", with message "451 4.4.2 Timeout waiting for data from client. " src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:459
Generiert von: Unbekanntes Konto 8 September 2021 um 10:43
Stack-Trace
#0 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(344): Swift_Transport_AbstractSmtpTransport->assertResponseCode('451 4.4.2 Timeo...', Array)
#1 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(305): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM:<kont...', Array, Array, true, NULL)
#2 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php(386): Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM:<kont...', Array, Array, true)
#3 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(485): Swift_Transport_EsmtpTransport->doMailFromCommand('kontakt@planet-...')
#4 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(518): Swift_Transport_AbstractSmtpTransport->doMailTransaction(Object(Swift_Message), 'kontakt@planet-...', Array, Array)
#5 src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(206): Swift_Transport_AbstractSmtpTransport->sendTo(Object(Swift_Message), 'kontakt@planet-...', Array, Array)
#6 src/XF/Mail/Mailer.php(304): Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
#7 src/XF/Mail/Queue.php(138): XF\Mail\Mailer->send(Object(Swift_Message), Object(XF\Mail\SmtpTransport), Array)
#8 src/XF/Job/MailQueue.php(12): XF\Mail\Queue->run(7.97879)
#9 src/XF/Job/Manager.php(258): XF\Job\MailQueue->run(7.97879)
#10 src/addons/SV/CachePermissionChecks/XF/Job/Manager.php(17): XF\Job\Manager->runJobInternal(Array, 7.97879)
#11 src/XF/Job/Manager.php(200): SV\CachePermissionChecks\XF\Job\Manager->runJobInternal(Array, 7.97879)
#12 src/XF/Job/Manager.php(84): XF\Job\Manager->runJobEntry(Array, 7.97879)
#13 src/XF/Cli/Command/RunJobs.php(59): XF\Job\Manager->runQueue(false, 8)
#14 src/vendor/symfony/console/Command/Command.php(255): XF\Cli\Command\RunJobs->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 src/vendor/symfony/console/Application.php(992): 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(255): 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(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 src/XF/Cli/Runner.php(109): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 cmd.php(15): XF\Cli\Runner->run()
#20 {main}
Status der Anfrage
array(1) {
  ["cli"] => string(66) "/var/www/share/mydomain.com/htdocs/cmd.php --quiet xf:run-jobs"
}
 
Same thing happens with Google mail, leading me to believe it is an issue with Swiftmailer, not Amazon SES or Google Gmail. This didn't happen until relatively recent versions of XF. I do not believe it is a bug in the XF code.
 
Possibly useful datapoint: I host two XF instances on dedicated servers, both are using Amazon SES for mail and both are running Plesk, however I only get this error on the server running Debian 9. The other server is Ubuntu 18. I don't recall fudging any settings related to SMTP or mail differently on these two servers.
 
So there are around 2.500 errors like this in my error log, just from the past 7 days. After looking around for this error, i found the solution to set the ping_threshold to 10 in the config of the SMTP mailer. Is there any possibility to do this within the xenforo config file?
 
So there are around 2.500 errors like this in my error log, just from the past 7 days. After looking around for this error, i found the solution to set the ping_threshold to 10 in the config of the SMTP mailer. Is there any possibility to do this within the xenforo config file?
Did you resolve this? Am having the same issue. Changing port doesn't seem to help.
 
I am not sure if my problem is the same as discussed in this thread...but it appears to be similar.

I started using Amazon SES 3 weeks ago. XF has been successfully sending emails without any unexpected errors. Starting yesterday, I began receiving numerous server log errors like this one:
1672506144560.webp
These errors are continuing today (about 50 yesterday and about 10 more so far this morning). The errors are all "Connection could not be established....Connection timed out". Everything looks fine in my Amazon SES dashboard.

I initially though that perhaps Amazon's server was down. But that's not the case because some messages are being sent successfully; I know that because of the total successful message count within the last 24 hours on my SES dashboard, and the fact that I have received messages from XF at my personal mailbox during the time of these errors.

What is suddenly causing these errors...given that SES has been fine for the 3 weeks prior?
 
Back
Top Bottom