Externalizable
Member
- Affected version
- XenForo 2.2.4
Hey, we've been monitoring 3 individual errors appear frequently in the ACP Server Error Log:
Our XenForo installation is set-up to send emails to AWS using SMTP. (us-east-1, port 587, TLS encryption)
What appears to have solved this issue is manually closing the Swift_Transport by extending and modifying \XF\Mail\Mailer::send:
Note that the finally block takes care of properly closing the transport.
This is obviously just a hot-fix on our side. I'm wondering if not closing the transport is intended, and if there is a proper solution we should be looking for.
Thanks!
Code:
ErrorException: Email to user@example.com failed: [E_WARNING] fwrite(): SSL: Broken pipe src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:240
Code:
Swift_TransportException: Email to user@example.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:383
Code:
Email to user@example.com failed: Expected response code 250 but got code "", with message ""
Our XenForo installation is set-up to send emails to AWS using SMTP. (us-east-1, port 587, TLS encryption)
What appears to have solved this issue is manually closing the Swift_Transport by extending and modifying \XF\Mail\Mailer::send:
PHP:
try
{
$sent = $transport->send($message, $failedRecipients);
if (!$sent)
{
throw new \Swift_TransportException('Unable to send mail.');
}
}
catch (\Throwable $e)
{
if ($this->queue && $allowRetry)
{
$this->queue->queueForRetry($message, $queueEntry);
}
\XF::logException($e, false, "Email to {$toEmails} failed:");
}
finally
{
$transport->stop();
}
This is obviously just a hot-fix on our side. I'm wondering if not closing the transport is intended, and if there is a proper solution we should be looking for.
Thanks!
Last edited: