Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sender address rejected: not owned by user #1220

Closed
daedric7 opened this issue Jan 9, 2023 · 1 comment
Closed

Sender address rejected: not owned by user #1220

daedric7 opened this issue Jan 9, 2023 · 1 comment

Comments

@daedric7
Copy link

daedric7 commented Jan 9, 2023

Steps to Reproduce

  1. ... Deploy wger via docker-compose
  2. ... Configure prod.env with email addresses
  3. ... Configure prod.env with valid smtp config

Expected results: Emails sent with the account defined in FROM_EMAIL

Actual results:

wger_server  | Exception in thread Thread-3 (send_email_thread):
wger_server  | Traceback (most recent call last):
wger_server  |   File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
wger_server  |     self.run()
wger_server  |   File "/usr/lib/python3.10/threading.py", line 953, in run
wger_server  |     self._target(*self._args, **self._kwargs)
wger_server  |   File "/usr/local/lib/python3.10/dist-packages/django_email_verification/confirm.py", line 97, in send_email_thread
wger_server  |     msg.send()
wger_server  |   File "/usr/local/lib/python3.10/dist-packages/django/core/mail/message.py", line 298, in send
wger_server  |     return self.get_connection(fail_silently).send_messages([self])
wger_server  |   File "/usr/local/lib/python3.10/dist-packages/django/core/mail/backends/smtp.py", line 131, in send_messages
wger_server  |     sent = self._send(message)
wger_server  |   File "/usr/local/lib/python3.10/dist-packages/django/core/mail/backends/smtp.py", line 149, in _send
wger_server  |     self.connection.sendmail(
wger_server  |   File "/usr/lib/python3.10/smtplib.py", line 901, in sendmail
wger_server  |     raise SMTPRecipientsRefused(senderrs)
wger_server  | smtplib.SMTPRecipientsRefused: {'[email protected]': (553, b'5.7.1 <[email protected]>: Sender address rejected: not owned by user [email protected]')}

No email is sent.

docker compose exec web python3 manage.py sendtestemail [email protected]

actually works, so i believe smtp settings in prod.env are correct.

ENABLE_EMAIL=true
EMAIL_HOST=mail.mydomain.com
EMAIL_PORT=587
[email protected]
EMAIL_HOST_PASSWORD=********************
EMAIL_USE_TLS=True
EMAIL_USE_SSL=False
[email protected]

I tried adding multiple settings to prod.env, to no avail:

[email protected]
EMAIL_FROM_ADDRESS='wger Workout Manager <[email protected]>'
DEFAULT_FROM_EMAIL='wger Workout Manager <[email protected]>'

The EMAIL_FROM_ADDRESS is always the default one:

docker compose exec web python3 manage.py diffsettings | grep example
WARN[0000] The "jw" variable is not set. Defaulting to a blank string. 
ADMINS = (('Your name', '[email protected]'),)
EMAIL_FROM_ADDRESS = 'wger Workout Manager <[email protected]>'  ###
MANAGERS = (('Your name', '[email protected]'),)
@rolandgeider
Copy link
Member

It seems you run into wger-project/docker#35 (I'm closing here, feel free to comment in the other ticket)

The strange thing is, I could send emails without any problems

@rolandgeider rolandgeider closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants