On 7/26/19 2:52 AM, Aaryan Bhagat wrote:
I am developing the processing of bounce messages as my GSoC project.
Currently theBounce Functions
are being developed in this pr on GitLab.
There is onebool
attribute calledbounce_you_are_disabled_warnings_interval
in theMailing List
model.
It's actually defined as Column(Interval) in your MR which what it should be.
It means
The number of days between each disabled notification.
Implementing this has a problem
- Say in the case of
process_bounces
function which processes theBounceEvents
function it is easy it just takes one by one the events from the database and processes them.- In the case of
Send_Warnings
function if the same approach was followed, meaning it would take one by one theAddress
instances, check tuples in thebounce_info
attribute ( see the pr for this ) and see whether to send a warning mail or not to can be a slow method.- Let's suppose the
Addresses
list is very long, then anAddress
instance in the very bottom of the list whose subscription has been disabled and some warning emails send, now waits to receive another mail as the interval is more thanbounce_you_are_disabled_warnings_interval
.- If the function is enumerating from the top then in order to take action first it has to reach this
Address
instance but the interval is already crossed. This can cause slow performance as thewarning mail
will be sent way late than it actually should have been sent.- Also if I am implementing 2 functions
process_bounces
andsend_warnings
what if both of them attempted at the sameAddress
instance?- Basically
implementation on sending warning mails
andimplementation to increase bounce_score
are separate things and they can cause problems if they processed the same instance.Pointers on above will be helpful. Am I missing something above?
You may consider doing this as it's done in MM 2.1. There, once a list's delivery is disabled by bounce for an address and the first notice sent, Mailman's processing has nothing further to do with it. There is a daily cron which is responsible for sending notices and ultimately removing disabled users.
A partially migrated version of this is at <https://gitlab.com/mailman/mailman/blob/master/port_me/disabled.py>
You might consider implementing this as a 'mailman' subcommand to be run daily by cron to do this task.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan