More often than we'd like it so happens that a bug appears in our code, and especially in case of critical bugs one probably has set up en email address to which those error messages are being sent. The problem is that even in the case of a small to medium website that would mean that thousands of emails get sent to the website administrator with basically the same error message. Now if the email server is hosted on the same machine as the website itself that could complicate things even more.

This patch tries to somehow control that. In the Email logging admin section under /admin/settings/logging/emaillog it adds a new setting, which I've called "The upper limit for email alerts" (it defaults to 10). So, basically, when an error occurs on a live website this variable limits the number of identical consecutive emails that are sent to the administrator to 10 (instead of hundreds of thousands).

Comments

mihai_t’s picture

Forgot to mention it in the patch description... The patch is actually a little bit smarter than described; more exactly when it tries to send a new alert email it tries to see if the previous email that was sent is "similar enough" to the one about to be sent. "Similar enough" means that the Levenshtein distance between the two emails is higher than 0.9 (where the Levenshtein distance between 2 identical emails would be 1).

Hope that is helps someone out=there :)

maciej.zgadzaj’s picture

Status: Active » Closed (fixed)

Thanks mihai_t. I have added a new feature based on your solution to 6.x-2.x-dev and 7.x-2.x-dev releases.