SMTPRecipientsRefused: Sender address rejected: not owned by user

972 views
Skip to first unread message

Tom Tanner

unread,
May 15, 2018, 8:38:48 PM5/15/18
to Django users
I have a Django app running on a server with uWSGI and nginx. 

In my `local_settings.py` file I have this:

    ###############
    # EMAIL SETUP #
    ###############
    EMAIL_HOST = 'smtp.privateemail.com'
    EMAIL_HOST_USER = 'sup...@mydomain.com'
    EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD'
    EMAIL_PORT = 465
    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_USE_TLS = True
    
    
    ########################
    # OTHER EMAIL SETTINGS #
    ########################
    ADMIN_EMAIL = "ad...@mydomain.com"
    SUPPORT_EMAIL = "sup...@mydomain.com"
    DEFAULT_FROM_EMAIL = ADMIN_EMAIL
    SERVER_EMAIL = ADMIN_EMAIL

I run `python manage.py runserver` on my local machine in the Django project's virtual environment. I fill out the password reset form at `password_rest/` using the email `my.pe...@gmail.com` and submit it. I get this error.

    SMTPRecipientsRefused: {u'my.pe...@gmail.com': (553, '5.7.1 <ad...@mydomain.com>: Sender address rejected: not owned by user sup...@mydomain.com')}

My website's email provider is Namecheap.

Why do I get this error when testing on my local machine? What must I change/add to get rid of it?

Daniel Germano Travieso

unread,
May 19, 2018, 11:59:34 PM5/19/18
to Django users
The problem you are having is described by the error message.

The email <ad...@mydomain.com> you are using and configured on the settings.py to be the DEFAULT_FROM_EMAIL is not being recognized by the email server. Maybe you lack the configuration of that email address on the email provider?

Either way, on the DEFAULT_FROM_EMAIL you should put a email that your email provider recognizes. If you want, you can use the reply_to attribute so the replies are sent to <ad...@mydomain.com> after the email you have <sup...@mydomain.com> sent the email.

Hope it helps!

On Tuesday, May 15, 2018 at 9:38:48 PM UTC-3, Tom Tanner wrote:
I have a Django app running on a server with uWSGI and nginx. 

In my `local_settings.py` file I have this:

    ###############
    # EMAIL SETUP #
    ###############
    EMAIL_HOST = 'smtp.privateemail.com'
    EMAIL_HOST_USER = 'sup...@mydomain.com'
    EMAIL_HOST_PASSWORD = 'MY EMAIL PASSWORD'
    EMAIL_PORT = 465
    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_USE_TLS = True
    
    
    ########################
    # OTHER EMAIL SETTINGS #
    ########################
    ADMIN_EMAIL = "ad...@mydomain.com"
    SUPPORT_EMAIL = "sup...@mydomain.com"
    DEFAULT_FROM_EMAIL = ADMIN_EMAIL
    SERVER_EMAIL = ADMIN_EMAIL

I run `python manage.py runserver` on my local machine in the Django project's virtual environment. I fill out the password reset form at `password_rest/` using the email `my.pe...@gmail.com` and submit it. I get this error.

    SMTPRecipientsRefused: {u'my.p...@gmail.com': (553, '5.7.1 <ad...@mydomain.com>: Sender address rejected: not owned by user sup...@mydomain.com')}
Reply all
Reply to author
Forward
0 new messages