summaryrefslogtreecommitdiff
path: root/Mailman/pipeline/cook_headers.py
diff options
context:
space:
mode:
authorBarry Warsaw2008-02-17 17:34:21 -0500
committerBarry Warsaw2008-02-17 17:34:21 -0500
commit69d158b13ae9cfa37040c2e7a664ca266b42050b (patch)
tree07f48ee990b6bab514f86199eaa250a04280120c /Mailman/pipeline/cook_headers.py
parentb36de8a6a5b84021c003b728274f7e9e95861c9d (diff)
downloadmailman-69d158b13ae9cfa37040c2e7a664ca266b42050b.tar.gz
mailman-69d158b13ae9cfa37040c2e7a664ca266b42050b.tar.zst
mailman-69d158b13ae9cfa37040c2e7a664ca266b42050b.zip
Diffstat (limited to 'Mailman/pipeline/cook_headers.py')
-rw-r--r--Mailman/pipeline/cook_headers.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/Mailman/pipeline/cook_headers.py b/Mailman/pipeline/cook_headers.py
index 4797de62b..0a63a727e 100644
--- a/Mailman/pipeline/cook_headers.py
+++ b/Mailman/pipeline/cook_headers.py
@@ -17,19 +17,24 @@
"""Cook a message's headers."""
+__metaclass__ = type
+__all__ = ['CookHeaders']
+
+
import re
from email.Charset import Charset
from email.Errors import HeaderParseError
from email.Header import Header, decode_header, make_header
from email.Utils import parseaddr, formataddr, getaddresses
+from zope.interface import implements
from Mailman import Utils
from Mailman import Version
from Mailman.app.archiving import get_archiver
from Mailman.configuration import config
from Mailman.i18n import _
-from Mailman.interfaces import Personalization, ReplyToMunging
+from Mailman.interfaces import IHandler, Personalization, ReplyToMunging
CONTINUATION = ',\n\t'
COMMASPACE = ', '
@@ -336,3 +341,17 @@ def ch_oneline(headerstr):
except (LookupError, UnicodeError, ValueError, HeaderParseError):
# possibly charset problem. return with undecoded string in one line.
return ''.join(headerstr.splitlines()), 'us-ascii'
+
+
+
+class CookHeaders:
+ """Modify message headers."""
+
+ implements(IHandler)
+
+ name = 'cook-headers'
+ description = _('Modify message headers.')
+
+ def process(self, mlist, msg, msgdata):
+ """See `IHandler`."""
+ process(mlist, msg, msgdata)