A cron task to periodically clear the VERP bounce counts

Bug #1261234 reported by Aaron Wells on 2013-12-15
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cecilia Vela Gurovic

Bug Description

Mahara has a VERP system to disable email addresses that have been bouncing. "Bounces_min" and "Bounces_ratio", and it disables an email when it has received more than "bounces_min" bounces and the ratio of bounced messages to all messages sent is greater than bounces_ratio.

The thing is, these are *lifetime* numbers, and never get reset. This poses some difficulties once a site has been around for a few years, like mahara.org. We have some email addresses that have received thousands of messages. So, if we set bounces_threshold to something like the default "0.2" setting, then if one of those longtime addresses become invalid, we would continue to send hundreds of messages to it before we got around to disabling it. On the other hand, if we set bounces_threshold to 0, then we have the problem that the bounce count is cumulative and never gets reset. So, if we leave it at the default 5 emails, I could get disabled due to one bounce every three months over the course of a year and a half.

Really, whether to disable someone's email should be based on how much it has been bouncing *recently*. So what we should do is add a cron task which sets the artefact_internal_profile_email.maillsent and artefact_internal_profile_email.bouncecount columns back to 0 periodically.

Aaron Wells (u-aaronw) wrote :

Ideally, the frequency would be something that could be set by a config variable, and each bounce would individually age out when it hit the age limit. But, to do that we'd need to create a new table to track the bounces and a lot of logic, so it's probably not worth it. I think instead, arbitrarily just zeroing everything every N days gets us fairly close to the same thing:

1. We add a config variable called, say, $cfg->bounces_resetdays, which takes an integer representing how many days we should go between resetting the bouncecounts.

2. We add a cron task that runs once daily. It uses a value in interaction_config to determine the last time it zeroed the bouncecounts, and by comparing that and $cfg->bounces_resetdays, it's determines whether to zero stuff out on this cron run or not.

3. If $cfg->bounces_resetdays = 0, or false, the cron task exits early and never resets them.

Changed in mahara:
importance: Undecided → Low
assignee: nobody → Aaron Wells (u-aaronw)
importance: Low → Medium
milestone: none → 1.9.0
Aaron Wells (u-aaronw) on 2014-02-25
Changed in mahara:
milestone: 1.9.0 → 1.10.0
Aaron Wells (u-aaronw) on 2014-08-11
Changed in mahara:
milestone: 1.10.0 → 1.11.0
Aaron Wells (u-aaronw) on 2015-03-06
Changed in mahara:
milestone: 15.04.0 → 15.10.0
status: New → Confirmed
Aaron Wells (u-aaronw) on 2015-10-23
Changed in mahara:
milestone: 15.10.0 → 16.04.0
Changed in mahara:
milestone: 16.04.0 → 16.10.0
Robert Lyon (robertl-9) on 2016-10-20
Changed in mahara:
milestone: 16.10.0 → 16.10.1
Robert Lyon (robertl-9) on 2016-10-21
Changed in mahara:
milestone: 16.10.1 → 17.04.0
Changed in mahara:
assignee: Aaron Wells (u-aaronw) → nobody
Robert Lyon (robertl-9) on 2017-03-27
Changed in mahara:
milestone: 17.04.0 → 17.10.0
Robert Lyon (robertl-9) on 2017-09-18
Changed in mahara:
milestone: 17.10.0 → 18.04.0
Robert Lyon (robertl-9) on 2018-03-07
Changed in mahara:
milestone: 18.04.0 → 18.10.0
Changed in mahara:
assignee: nobody → Cecilia Vela Gurovic (ceciliavg)
status: Confirmed → In Progress
Changed in mahara:
milestone: 18.10.0 → 19.04.0

Reviewed: https://reviews.mahara.org/8803
Committed: https://git.mahara.org/mahara/mahara/commit/37525e30bd0b886e687e15e2e49e7ed0e9bfe1e4
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 37525e30bd0b886e687e15e2e49e7ed0e9bfe1e4
Author: Cecilia Vela Gurovic <email address hidden>
Date: Thu Sep 7 18:03:35 2017 +1200

Bug 1261234: cron job for reseting VERP values

Change-Id: Ic549b35dac2d4c069005adba15f721229671294e

Robert Lyon (robertl-9) on 2019-01-07
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
importance: Medium → Wishlist
tags: added: nominatedfeature
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers