On Wed, Jun 19, 2019, at 7:09 AM, Mark Sapiro wrote:
On 6/18/19 10:56 PM, Aaryan Bhagat wrote:
Ok, so from what I get I will explain by taking an
example
address subscribed to 2 mailing list.
- Create a bounce_score attribute in the address model.
- Bounces generate from both the lists will add up the bounce_score attribute.
- If
bounce_score >= bounce_score_threshold of list1
disable membership of list 1.- If
bounce_score>=bounce_score_threshold of list2
disable membership of list2.Is the above inference correct?
I would do this differently.
The bounce_info attribute of the address is a possibly empty list of tuples. Each tuple contains things like the list_id, the current score and last_bounce_received. In MM 2.1 the bounce_info for a list also contained the remaining number of notices and the time of the last notice sent to control the sending of notices and eventual removal of an address with delivery disabled by bounce.
Storing list of tuples in database might be inefficient for reads. I don't think there is an accurate column type one could use for this purpose unless we convert them to string back and forth.
I suggested going with Member because it comes close to what we require, although memberships can include Users along with addresses which may not be great.
It looks like now there is a need for a BounceInfo model then which could be used to store the information instead of a list of tuples. It could keep the following attributes:
- Address (relationship -> Address)
- MailingList (relationship -> MailingList)
- last_bounce (datetime)
- last_notice (datetime)
- remaining_notices (int)
- total_notices_sent (int)
I am not sure if the bounce score of an address is calculated per-address or is global regardless of a MailingList in Mailman 2.
If it is global, then the score could be stored in Address table, otherwise BounceInfo table.
This way, you keep track of bounces by list and ultimately may disable delivery to the address from only the one list on which the score reaches threshold.
-- Mark Sapiro mark@msapiro.net The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Mailman-Developers mailing list -- mailman-developers@python.org To unsubscribe send an email to mailman-developers-leave@python.org https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3
Security Policy: https://wiki.list.org/x/QIA9
-- thanks, Abhilash Raj (maxking)