summaryrefslogtreecommitdiff
path: root/src/mailman/model/bounce.py
diff options
context:
space:
mode:
authorBarry Warsaw2011-05-17 16:25:25 -0400
committerBarry Warsaw2011-05-17 16:25:25 -0400
commit8e86c361c33c5f51ce8215173b8e9703be4af7f9 (patch)
tree461b066e8aa3953543e927b7b1b31ea7ba097f5e /src/mailman/model/bounce.py
parentae5fe445251b22aaed0a986600b982a27279b2c7 (diff)
downloadmailman-8e86c361c33c5f51ce8215173b8e9703be4af7f9.tar.gz
mailman-8e86c361c33c5f51ce8215173b8e9703be4af7f9.tar.zst
mailman-8e86c361c33c5f51ce8215173b8e9703be4af7f9.zip
Diffstat (limited to 'src/mailman/model/bounce.py')
-rw-r--r--src/mailman/model/bounce.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/mailman/model/bounce.py b/src/mailman/model/bounce.py
index 8abe3d149..20953b0ff 100644
--- a/src/mailman/model/bounce.py
+++ b/src/mailman/model/bounce.py
@@ -29,10 +29,11 @@ __all__ = [
from storm.locals import Bool, Int, DateTime, Unicode
from zope.interface import implements
-from mailman.interfaces.bounce import (
- BounceContext, IBounceEvent, IBounceProcessor)
+from mailman.config import config
from mailman.database.model import Model
from mailman.database.types import Enum
+from mailman.interfaces.bounce import (
+ BounceContext, IBounceEvent, IBounceProcessor)
from mailman.utilities.datetime import now
@@ -63,4 +64,19 @@ class BounceProcessor:
def register(self, mlist, email, msg, where=None):
"""See `IBounceProcessor`."""
- return BounceEvent(mlist.fqdn_listname, email, msg, where)
+ event = BounceEvent(mlist.fqdn_listname, email, msg, where)
+ config.db.store.add(event)
+ return event
+
+ @property
+ def events(self):
+ """See `IBounceProcessor`."""
+ for event in config.db.store.find(BounceEvent):
+ yield event
+
+ @property
+ def unprocessed(self):
+ """See `IBounceProcessor`."""
+ for event in config.db.store.find(BounceEvent,
+ BounceEvent.processed == False):
+ yield event