Skip to content

Authentication Credentials Invalid

0

I created an IAM user with IAMFullAccess Permissions and the following inline permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "ses:SendRawEmail",
            "Resource": "*"
        }
    ]
}

I also created access keys and can use them with aws iam get-user to properly retrieve information.

However, when I use those same keys with an email client to send email I get this message:

Error sending email: (535, b'Authentication Credentials Invalid')

I have another user set up the exact same way and the email client works.

Why am I getting this error?

1 Answer
0

The issue is that you're trying to use IAM access keys directly for SMTP authentication with Amazon SES, which won't work. For SMTP authentication with SES, you need specific SMTP credentials that are different from your IAM access keys.

When using SES with an email client via SMTP, you need to:

  1. Generate SMTP credentials specifically for SES. These are different from regular IAM access keys, even though they're derived from IAM credentials.

  2. Make sure you're creating these SMTP credentials in the correct AWS region where your SES service is configured.

  3. Ensure your IAM user has the proper permissions. While you have "ses:SendRawEmail" permission, you might also need "ses:SendEmail" depending on how your email client is sending messages.

To fix this issue:

  • Go to the SES console
  • Navigate to the SMTP settings section
  • Create SMTP credentials specifically for your IAM user
  • Use these SMTP credentials (not your IAM access keys) in your email client

This explains why your other user works - it likely has proper SMTP credentials configured, not just IAM access keys.
Sources
Amazon SES bug or problem | AWS re:Post
Identity and access management in Amazon SES - Amazon Simple Email Service
Python3 boto3 email-sending error in EC2 (ubuntu) | AWS re:Post

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.