summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2001-12-19 06:19:03 +0000
committerbwarsaw2001-12-19 06:19:03 +0000
commit9d01a94a431631e3e712ecb3dbe4fd49b620e8d2 (patch)
tree97888f6761ee0d50183a3d615c879705d180e5d7
parente72345b8338edfcade82b337037608538dda071a (diff)
downloadmailman-9d01a94a431631e3e712ecb3dbe4fd49b620e8d2.tar.gz
mailman-9d01a94a431631e3e712ecb3dbe4fd49b620e8d2.tar.zst
mailman-9d01a94a431631e3e712ecb3dbe4fd49b620e8d2.zip
First step on the bounce processer sanity road. These changes fix
Mailman to keep track of why (and when) delivery is disabled. New list attribute delivery_status and new MemberAdaptor interface methods are added. Delivery status has the following states: ENABLED, BYUSER (disabled by user selection), BYADMIN (disabled by admin selection), BYBOUNCE (disabled by excessive bouncing), UNKNOWN (legacy disable). We no longer use the DisableDelivery user option. Also, for status changes from <anything> -> <anything-but-ENABLED>, we record the time.time(). This information gets thrown away when the delivery is re-enabled. Specific changes here: Added delivery status ENABLED, UNKNOWN, BYUSER, BYADMIN, BYBOUNCE. getDeliveryStatus(), getDeliveryStatusChangeTime(), getBounceInfo(), setDeliveryStatus(), setBounceInfo(): New methods -- note the *BounceInfo() methods may change.
-rw-r--r--Mailman/MemberAdaptor.py78
1 files changed, 78 insertions, 0 deletions
diff --git a/Mailman/MemberAdaptor.py b/Mailman/MemberAdaptor.py
index e14ffd5ac..af38b10c3 100644
--- a/Mailman/MemberAdaptor.py
+++ b/Mailman/MemberAdaptor.py
@@ -47,6 +47,15 @@ raised.
"""
+# Delivery statuses
+ENABLED = 0 # enabled
+UNKNOWN = 1 # legacy disabled
+BYUSER = 2 # disabled by user choice
+BYADMIN = 3 # disabled by admin choice
+BYBOUNCE = 4 # disabled by bounces
+
+
+
class MemberAdaptor:
#
# The readable interface
@@ -149,6 +158,45 @@ class MemberAdaptor:
"""
raise NotImplemented
+ def getDeliveryStatus(self, member):
+ """Return the delivery status of this member.
+
+ Value is one of the module constants:
+
+ ENABLED - The deliveries to the user are not disabled
+ UNKNOWN - Deliveries are disabled for unknown reasons. The
+ primary reason for this to happen is that we've copied
+ their delivery status from a legacy version which didn't
+ keep track of disable reasons
+ BYCHOICE - The user explicitly disable deliveries
+ BYBOUNCE - The system disabled deliveries due to bouncing
+
+ If member is not a member of the list, raise NotAMemberError.
+ """
+ raise NotImplemented
+
+ def getDeliveryStatusChangeTime(self, member):
+ """Return the time of the last disabled delivery status change.
+
+ If the current delivery status is ENABLED, the status change time will
+ be zero. If member is not a member of the list, raise
+ NotAMemberError.
+ """
+ raise NotImplemented
+
+ def getBounceInfo(self, member):
+ """Return the member's bounce information.
+
+ A value of None means there is no bounce information registered for
+ the member.
+
+ Bounce info is opaque to the MemberAdaptor. It is set by
+ setBounceInfo() and returned by this method without modification.
+
+ If member is not a member of the list, raise NotAMemberError.
+ """
+ raise NotImplemented
+
#
# The writeable interface
@@ -245,3 +293,33 @@ class MemberAdaptor:
topics must be a sequence of strings.
"""
raise NotImplemented
+
+ def setDeliveryStatus(self, member, status):
+ """Set the delivery status of the member's address.
+
+ Status must be one of the module constants:
+
+ ENABLED - The deliveries to the user are not disabled
+ UNKNOWN - Deliveries are disabled for unknown reasons. The
+ primary reason for this to happen is that we've copied
+ their delivery status from a legacy version which didn't
+ keep track of disable reasons
+ BYCHOICE - The user explicitly disable deliveries
+ BYBOUNCE - The system disabled deliveries due to bouncing
+
+ This method also records the time (in seconds since epoch) at which
+ the last status change was made. If the delivery status is changed to
+ ENABLED, then the change time information will be deleted. This value
+ is retrievable via getDeliveryStatusChangeTime().
+ """
+ raise NotImplemented
+
+ def setBounceInfo(self, member, info):
+ """Set the member's bounce information.
+
+ When info is None, any bounce info for the member is cleared.
+
+ Bounce info is opaque to the MemberAdaptor. It is set by this method
+ and returned by getBounceInfo() without modification.
+ """
+ raise NotImplemented