diff options
author | tkikuchi <> | 2005-02-17 13:30:26 +0000 |
---|---|---|
committer | tkikuchi <> | 2005-02-17 13:30:26 +0000 |
commit | 18fdecfb201a1c7a62b4d5780e45b1ad345faa55 (patch) | |
tree | 9b700168af1ac5b9ce14774421be64104cc7795d /Mailman/Handlers | |
parent | 40e26e7aa79f965b5b0765bae1d4db1f93141e81 (diff) | |
download | mailman2-18fdecfb201a1c7a62b4d5780e45b1ad345faa55.tar.gz mailman2-18fdecfb201a1c7a62b4d5780e45b1ad345faa55.tar.xz mailman2-18fdecfb201a1c7a62b4d5780e45b1ad345faa55.zip |
Anonymous list fix up: Add internal_name in the From: header.
Log anonymize record in 'post' for admin's inspection convenience.
Diffstat (limited to 'Mailman/Handlers')
-rw-r--r-- | Mailman/Handlers/Cleanse.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Mailman/Handlers/Cleanse.py b/Mailman/Handlers/Cleanse.py index b2c631fa..658d04c6 100644 --- a/Mailman/Handlers/Cleanse.py +++ b/Mailman/Handlers/Cleanse.py @@ -16,6 +16,11 @@ """Cleanse certain headers from all messages.""" +from email.Utils import formataddr + +from Mailman.Logging.Syslog import syslog +from Mailman.Handlers.CookHeaders import uheader + def process(mlist, msg, msgdata): # Always remove this header from any outgoing messages. Be sure to do @@ -26,12 +31,15 @@ def process(mlist, msg, msgdata): del msg['urgent'] # We remove other headers from anonymous lists if mlist.anonymous_list: + syslog('post', 'post to %s from %s anonymized', + mlist.internal_name(), msg.get('from')) del msg['from'] del msg['reply-to'] del msg['sender'] # Hotmail sets this one del msg['x-originating-email'] - msg['From'] = mlist.GetListEmail() + i18ndesc = str(uheader(mlist, mlist.description, 'From')) + msg['From'] = formataddr((i18ndesc, mlist.GetListEmail())) msg['Reply-To'] = mlist.GetListEmail() # Some headers can be used to fish for membership del msg['return-receipt-to'] |