openSUSE / osem

Open Source Event Manager. An event management tool tailored to Free and Open Source Software conferences.
http://osem.io
MIT License
873 stars 492 forks source link

HTTP 500 when SMTP server is not available #1403

Open TheAssassin opened 7 years ago

TheAssassin commented 7 years ago

Whenever the SMTP server is not available, the very non intuitive error 500 page is displayed. I noticed this every time during registration tests while writing a Dockerfile when an SMTP server was not available, which was the reason for having to set up MailHog for testing.

I think OSEM should display a message like "mail could not be sent, please try again later".

differentreality commented 7 years ago

@TheAssassin how is this reproducable in development?

TheAssassin commented 7 years ago

Just set OSEM_SMTP_ADDRESS and/or OSEM_SMTP_PORT to some random host that doesn't exist or at least does not provide an SMTP server (e.g. localhost and 12345). Then try to register. OSEM creates the user, and you can login, but after it finished the database interactions, it tries to send the mail to the SMTP gateway, and as the service is not available, a 500 page is rendered and shown. If you need/want a traceback, tell me and I'll spin up a container.

JewelSam commented 7 years ago

@differentreality I don't know how important this task so I made quick decision (see in commit). If you say it's okay I will improve it. Problems which I noticed:

kormoc commented 7 years ago

We ran into this issue and it ended up confusing our users a lot.

If the user registers, could the message be "confirmation mail could not be sent, please go to your profile and try resending later" or something like that? Having the user unable to confirm and not knowing what to do next adds a lot of support burden on us.

Thanks!