0

I've set-up email sending in my Django project that is deployed on AWS. When I run it locally the emails go out without a problem, but when I try it on production server on EC2 ubuntu VM, I get smtplib.SMTPAuthenticationError: (535, b'5.7.0 Authentication disabled due to threshold limitation') error.

My settings are the same on both machines:

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST = 'mail.my-provider.com' EMAIL_PORT = 1025 EMAIL_HOST_USER = '[email protected]' EMAIL_HOST_PASSWORD = 'mypassword' 

Is there anything specific I need to do to be able to send emails form AWS? My outbound rules are set wide open.

1
  • 1
    The error is coming from your mail service provider - you will need to contact them to ask what the problem is. Seems like you have exceeded some quota on your mail service. Commented Nov 5 at 4:56

1 Answer 1

1

That error means your SMTP provider temporarily disabled authentication because of a rate or login threshold.
It’s not related to AWS itself — it’s a protection mechanism from your mail provider (e.g. too many failed logins or connections from different IPs).

Here’s what you can do:

  1. Wait or contact your mail provider — many providers temporarily disable SMTP auth for 10–60 minutes if too many connections or logins are detected.

  2. Whitelist your EC2 IP — some SMTP servers block unknown IPs or require trusted IP ranges.

  3. Enable SMTP auth for external apps — check your provider’s dashboard for “Allow external SMTP clients” or “Less secure apps”.

  4. Try port 587 (STARTTLS) instead of 1025 — port 1025 is often only for local testing or mail relays, not for production.

    EMAIL_PORT = 587 EMAIL_USE_TLS = True 
  5. Check your credentials and environment variables — make sure AWS env vars are set properly and not empty strings.

If you’re testing locally with a mock SMTP server like MailHog, make sure to switch to your provider’s real SMTP endpoint in production.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.