Django Errors Going to Spam

Like many sites I’ve setup Django to email me when there are errors. Unfortunately the errors were all ending up in my spam. I had a look at the mail system and there were no problems there.

The first issue was very simple. It’d not set SERVER_EMAIL in settings.py which meant that the emails were being sent from ‘root@localhost’ which spam filters are not going to like.

The second problem was the very large number of emails which was also a problem for me in that I stopped taking the emails seriously. The Django ALLOWED_HOSTS setting improves security but generates a lot of errors (this has been fixed in the development version of Django but for now it fills up the log).

I found an excellent article Prevent email notification on SuspiciousOperation with detailed code which I’ve implemented and it’s made a huge difference.

Read full article at “Planet Django”

Leave a comment