laravelamazon-sqsmailer

Laravel 9 mail on production get only this error - Expected response code "250" but got code "451"


We've upgraded our application to Laravel 9 last week and noticed a large amount of failed jobs appearing as soon as we deployed the build in production.

Those errors were all email related with the following error message:

Expected response code "250" but got code "451", with message "451 4.4.2 Timeout waiting for data from client.".

We've reverted back to the previous build (which was using SwiftMailer) and the errors stopped. To clarify, we've been running the application for a few weeks and never had that error before.

On "Staging" we didn't have that issue. The only difference is we use SQS for queues in live and set :

APP_ENV=production
APP_DEBUG=false

that are the only differences.


Solution

  • Could you try adding 'ping_threshold' => 10, to your smtp or ses configuration in config/mail.php

    If you are using a queue worker/manager, remember to restart the process for the new configuration to come into effect.

    This seems to have resolved the issue for me. Could be coincidental, but will report back if the issue returns.