summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2000-12-20 21:35:15 +0000
committerbwarsaw2000-12-20 21:35:15 +0000
commit0dca44c72be8a94163fd422446716184fd23e992 (patch)
treeced55dc3c0f82f858f7d6fcc87abff9cfa7ca04f
parent1e0b4d6511245867d72290e12a799d0543def07a (diff)
downloadmailman-0dca44c72be8a94163fd422446716184fd23e992.tar.gz
mailman-0dca44c72be8a94163fd422446716184fd23e992.tar.zst
mailman-0dca44c72be8a94163fd422446716184fd23e992.zip
process(): Get rid of the string module in favor of string methods.
Also, don't set the X-BeenThere: header by appending to msg.headers; use the __setitem__() interface instead.
-rw-r--r--Mailman/Handlers/CookHeaders.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Mailman/Handlers/CookHeaders.py b/Mailman/Handlers/CookHeaders.py
index e51a82dde..4b13cd69e 100644
--- a/Mailman/Handlers/CookHeaders.py
+++ b/Mailman/Handlers/CookHeaders.py
@@ -17,11 +17,12 @@
"""Cook a message's Subject header.
"""
-import string
import re
import urlparse
from Mailman import mm_cfg
+CONTINUATION = ',\n\t'
+
def process(mlist, msg, msgdata):
@@ -58,7 +59,7 @@ def process(mlist, msg, msgdata):
msg['Errors-To'] = msgdata.get('errorsto', adminaddr)
#
# Mark message so we know we've been here
- msg.headers.append('X-BeenThere: %s\n' % mlist.GetListEmail())
+ msg['X-BeenThere'] = mlist.GetListEmail()
#
# Add Precedence: and other useful headers. None of these are standard
# and finding information on some of them are fairly difficult. Some are
@@ -125,7 +126,7 @@ def process(mlist, msg, msgdata):
# shouldn't be hardcoded. The adding of 2 is for the colon-space
# separator.
if len(h) + 2 + len(v) > 78:
- v = string.join(string.split(v, ', '), ',\n\t')
+ v = CONTINUATION.join(v.split(', '))
msg[h] = v
#
# Always delete List-Archive header, but only add it back if the list is