Queue messages and send them out in small batches

Bug #1413431 reported by Kristina Hoeppner
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Unassigned

Bug Description

When a Mahara training is taking place on a site and pages / collections are created in / shared with a group and "Shared page notifications" are turned on, a lot of emails can be generated. When they are sent out they can result in a mail server to reject them esp. if all users have the same email domain.

It would be better if a queue was established and sent out in smaller batches so that mail servers don't blackmail the sender.

Aaron Wells (u-aaronw)
tags: added: email notifications scalability
Revision history for this message
Aaron Wells (u-aaronw) wrote :

I did some initial work towards this under Bug 1284887.

Honestly, I feel like in a perfect world this would be something that your friendly sysadmin could configure your mail server to deal with. Kind of like how denial-of-service stuff is also better handled at the server level.

But this is a less-than-perfect world, so we may as well tackle it in Mahara.

The implementation route I took, was to create a mail_queue table in the Mahara database. All emails sent to users in Mahara go through the function "email_user()", so instead of making this function actually send the email, we would make it insert into the mail_queue table.

A later cron task would then take the most recent X emails from mail_queue and actually send them out. The number of messages to send out on each cron task, would be configurable.

Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 15.04.0 → 15.10.0
Aaron Wells (u-aaronw)
Changed in mahara:
status: New → Confirmed
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 15.10.0 → 16.04.0
Changed in mahara:
milestone: 16.04.0 → 16.10.0
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 16.10.0 → 16.10.1
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 16.10.1 → 17.04.0
Changed in mahara:
milestone: 17.04.0 → 17.10.0
importance: High → Medium
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 17.10.0 → 18.04.0
Robert Lyon (robertl-9)
Changed in mahara:
milestone: 18.04.0 → 18.10.0
Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Aaron's solution is sufficient right now until we need to make more changes.

Changed in mahara:
milestone: 18.10.0 → none
status: Confirmed → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.