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

No graceful error message when email authentication fails #2046

Closed
timobrembeck opened this issue Feb 1, 2023 · 0 comments · Fixed by #2349
Closed

No graceful error message when email authentication fails #2046

timobrembeck opened this issue Feb 1, 2023 · 0 comments · Fixed by #2349
Labels
🐛 bug Something isn't working ⁉️ prio: low Not urgent, can be resolved in the distant future. ☺️ effort: low Should be doable in <4h
Milestone

Comments

@timobrembeck
Copy link
Member

Describe the Bug

When the email credentials in the config are not working, all functions which involve sending emails are not failing gracefully, but showing an internal server error instead.

Steps to Reproduce

  1. Input wrong email config
  2. Resend e.g. an invitation link
  3. See error

Expected Behavior

A nice readable error message should be shown which explains the reason

Actual Behavior

An internal server error occurs

Additional Information

Traceback
Feb 01 09:57:40 ERROR   django.request - 500 Internal Server Error: /lkgoerlitz/users/1264/resend-activation-link/
Traceback (most recent call last):
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
  response = get_response(request)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
  response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/views/decorators/http.py", line 40, in inner
  return func(request, *args, **kwargs)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
  return view_func(request, *args, **kwargs)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/integreat_cms/cms/views/users/region_user_actions.py", line 86, in resend_activation_link_region
  send_welcome_mail(request, user, activation=True)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/integreat_cms/cms/utils/welcome_mail_utils.py", line 57, in send_welcome_mail
  send_mail(
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/integreat_cms/cms/utils/email_utils.py", line 73, in send_mail
  email.send()
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/core/mail/message.py", line 284, in send
  return self.get_connection(fail_silently).send_messages([self])
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
  new_conn_created = self.open()
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/core/mail/backends/smtp.py", line 69, in open
  self.connection.login(self.username, self.password)
File "/usr/lib/python3.9/smtplib.py", line 734, in login
  raise last_exception
File "/usr/lib/python3.9/smtplib.py", line 723, in login
  (code, resp) = self.auth(
File "/usr/lib/python3.9/smtplib.py", line 646, in auth
  raise SMTPAuthenticationError(code, resp)
smtplib.SMTPAuthenticationError: (534, b'5.7.9 Application-specific password required. Learn more at\n5.7.9  https://support.google.com/mail/?p=InvalidSecondFactor y6-xxx.34 - gsmtp')
@timobrembeck timobrembeck added 🐛 bug Something isn't working ⁉️ prio: low Not urgent, can be resolved in the distant future. ☺️ effort: low Should be doable in <4h labels Feb 1, 2023
@timobrembeck timobrembeck added this to the 23Q2 milestone Feb 1, 2023
@timobrembeck timobrembeck modified the milestones: 23Q2, 23Q3 Jul 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ⁉️ prio: low Not urgent, can be resolved in the distant future. ☺️ effort: low Should be doable in <4h
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant