summaryrefslogtreecommitdiff
path: root/Mailman/pipeline/tagger.py
diff options
context:
space:
mode:
Diffstat (limited to 'Mailman/pipeline/tagger.py')
-rw-r--r--Mailman/pipeline/tagger.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Mailman/pipeline/tagger.py b/Mailman/pipeline/tagger.py
index 0a87d8407..cde8547df 100644
--- a/Mailman/pipeline/tagger.py
+++ b/Mailman/pipeline/tagger.py
@@ -17,12 +17,22 @@
"""Extract topics from the original mail message."""
+__metaclass__ = type
+__all__ = ['Tagger']
+
+
import re
import email
import email.Errors
import email.Iterators
import email.Parser
+from zope.interface import implements
+
+from Mailman.i18n import _
+from Mailman.interfaces import IHandler
+
+
OR = '|'
CRNL = '\r\n'
EMPTYSTRING = ''
@@ -155,3 +165,17 @@ class _ForgivingParser(email.Parser.HeaderParser):
# Make sure we retain the last header
if lastheader:
container[lastheader] = NLTAB.join(lastvalue)
+
+
+
+class Tagger:
+ """Tag messages with topic matches."""
+
+ implements(IHandler)
+
+ name = 'tagger'
+ description = _('Tag messages with topic matches.')
+
+ def process(self, mlist, msg, msgdata):
+ """See `IHandler`."""
+ process(mlist, msg, msgdata)