I have a script written in CakePHP 2.10.18 (running on php 5.6, I know, old stuff). The script is set up to use AWS SES as SMTP server, which most of the time works fine, but every once in a while, without changing the code at all, the sending will fail, providing the following error message: SMTP server did not accept the password.
This is the Email configuration in CakePHP:
public $SMTP_config = array(
'transport' => 'Smtp',
'host' => 'email-smtp.us-east-1.amazonaws.com',
'port' => 587,
'timeout' => 30,
'username' => 'redacted',
'password' => 'redacted',
'client' => null,
'log' => true,
'returnPath' => '[email protected]',
'replyTo' => '[email protected]',
'tls' => true,
'charset' => 'utf-8',
'headerCharset' => 'utf-8'
);
The email address used as the from (same as the return path and reply to) is verified with AWS, everything looks good in the AWS console, DKIM verification ok, the account is in healthy status...
I can't seem to find what's causing this, any ideas? Why would the password be rejected and then accepted just a few seconds later when I run the script again? Any help would be much appreciated.
I had a similar problem and I discovered that the problem was that I was using an old SES user. When I ran some tests from the command line to test the SES connection it worked OK usually but every now and again (randomly) I would get the error shown in the image below. I created an new SMTP user to connect SES and the problem went away. Maybe I am naive but it seems that someone at AWS thought that a good way to deprecate a feature would be to make it cause intermittent failures randomly.
error message