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

Handle SMTP exceptions better during password reset #817

Closed
abompard opened this issue Nov 23, 2021 · 2 comments · Fixed by #1015
Closed

Handle SMTP exceptions better during password reset #817

abompard opened this issue Nov 23, 2021 · 2 comments · Fixed by #1015
Labels
bug Something isn't working EasyFix Good for newcomers S Small (~5 hours of work)

Comments

@abompard
Copy link
Member

We should handle this better than by giving out a 500 error:

[2021-11-23 11:58:21,836] ERROR in app: Exception on /forgot-password/ask [POST]
Traceback (most recent call last):
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/app-root/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/app-root/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/app-root/src/noggin/controller/password.py", line 163, in forgot_password_ask
    mailer.send(email)
  File "/opt/app-root/lib/python3.6/site-packages/flask_mail.py", line 492, in send
    message.send(connection)
  File "/opt/app-root/lib/python3.6/site-packages/flask_mail.py", line 427, in send
    connection.send(self)
  File "/opt/app-root/lib/python3.6/site-packages/flask_mail.py", line 192, in send
    message.rcpt_options)
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/smtplib.py", line 881, in sendmail
    raise SMTPRecipientsRefused(senderrs)
smtplib.SMTPRecipientsRefused: {'username@domain': (550, b'5.1.1 <username@domain>: Recipient address rejected: User unknown in local recipient table')}
@abompard abompard added bug Something isn't working EasyFix Good for newcomers S Small (~5 hours of work) labels Nov 23, 2021
@joshpetit
Copy link

Hey @abompard I'd like to work on this! Would the best thing be to remove all the stack traces and just output something like "550 error, User not found?" Also did you mean to say 550 error not 500?

@abompard
Copy link
Member Author

Hey! Sorry for not replying, are you still interested in this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working EasyFix Good for newcomers S Small (~5 hours of work)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants