summaryrefslogtreecommitdiff
path: root/src/mailman/interfaces/bounce.py
diff options
context:
space:
mode:
authorBarry Warsaw2011-05-13 10:25:38 +0200
committerBarry Warsaw2011-05-13 10:25:38 +0200
commite116cfac469673fad8446d93cddecdfdf6344039 (patch)
tree306fde9494c1a4fab2173e9242e917bdea84ddab /src/mailman/interfaces/bounce.py
parent091917126e7c58657310524882743e8391166fc3 (diff)
downloadmailman-e116cfac469673fad8446d93cddecdfdf6344039.tar.gz
mailman-e116cfac469673fad8446d93cddecdfdf6344039.tar.zst
mailman-e116cfac469673fad8446d93cddecdfdf6344039.zip
Diffstat (limited to 'src/mailman/interfaces/bounce.py')
-rw-r--r--src/mailman/interfaces/bounce.py48
1 files changed, 46 insertions, 2 deletions
diff --git a/src/mailman/interfaces/bounce.py b/src/mailman/interfaces/bounce.py
index 22e2467b8..e6d9e8ccd 100644
--- a/src/mailman/interfaces/bounce.py
+++ b/src/mailman/interfaces/bounce.py
@@ -22,12 +22,13 @@ from __future__ import absolute_import, unicode_literals
__metaclass__ = type
__all__ = [
'IBounceDetector',
+ 'IBounceEvent',
+ 'IBounceProcessor',
'Stop',
]
-from flufl.enum import Enum
-from zope.interface import Interface
+from zope.interface import Attribute, Interface
@@ -52,3 +53,46 @@ class IBounceDetector(Interface):
returned to halt any bounce processing pipeline.
:rtype: A set strings, or `Stop`
"""
+
+
+
+class IBounceEvent(Interface):
+ """Registration record for a single bounce event."""
+
+ list_name = Attribute(
+ """The name of the mailing list that received this bounce.""")
+
+ email = Attribute(
+ """The email address that bounced.""")
+
+ timestamp = Attribute(
+ """The timestamp for when the bounce was received.""")
+
+ message_id = Attribute(
+ """The Message-ID of the bounce message.""")
+
+ where = Attribute(
+ """Where was the bounce detected?""")
+
+ processed = Attribute(
+ """Has this bounce event been processed?""")
+
+
+
+class IBounceProcessor(Interface):
+ """Manager/processor of bounce events."""
+
+ def register(mlist, email, msg, where=None):
+ """Register a bounce event.
+
+ :param mlist: The mailing list that the bounce occurred on.
+ :type mlist: IMailingList
+ :param email: The email address that is bouncing.
+ :type email: str
+ :param msg: The bounce message.
+ :type msg: email.message.Message
+ :param where: A description of where the bounce was detected.
+ :type where: str
+ :return: The registered bounce event.
+ :rtype: IBounceEvent
+ """