revsys / django-health-check

a pluggable app that runs a full check on the deployment, using a number of plugins to check e.g. database, queue server, celery processes, etc.

Home Page:https://readthedocs.org/projects/django-health-check/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support email checking

dfrankow opened this issue · comments

commented

This is a feature request, possibly low-priority.

Thanks for your work on this project. Looks nice.

I was evaluating this versus django-watchman, and they have an email check.

Might be useful to implement this?

Looks like I could implement my own custom check here, but I thought I'd mention this.

Hi @dfrankow,

Interesting idea. What would you want to have tested? There are many email backends, so it could be tricky to test them all with a single check.

If you have anything in particular in mind, please share.

Best,
Joe

commented

Good question.

Ignoring difficulty, I think what I'd want to know is, "Is my email going to be received by someone?"

That includes being able to properly reach out to an SMTP server, having that email accepted for delivery, and having the proper setup for SPF and DMARC (see for example this check for google), which entails some DNS checks. Maybe there would even be a sink that receives the emails that can confirm receipt. I can imagine a money-making service you set up just to receive emails and offer up a REST API to check that it got there.

Now that's a lot. If all it did was send an email to EMAIL_HOST using the django.core.mail.backends.smtp.EmailBackend and check there is no error thrown, that might be a great start. Perhaps that's what django-watchman does?

django-watchman has a BSD-3 license, which I think means you could read and even use their code. However, I'm not a lawyer, so make your own determination.

Thanks for your attention.

I looked at the test they do. They simply send an email. I don't know if that's a good idea. In fact, they explicitly warn you to not enable it. I am not again adding something like it, but I will close the issue for now. Best, Joe