Update of /cvsroot/mailman/mailman/Mailman/Handlers
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9694
Modified Files:
Tag: Release_2_1-maint
Cleanse.py
Log Message:
Anonymous list fix up: Add internal_name in the From: header.
Log anonymize record in 'post' for admin's inspection convenience.
Index: Cleanse.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Handlers/Cleanse.py,v
retrieving revision 2.5.2.1
retrieving revision 2.5.2.2
diff -u -d -r2.5.2.1 -r2.5.2.2
--- Cleanse.py 22 Apr 2003 03:34:52 -0000 2.5.2.1
+++ Cleanse.py 17 Feb 2005 13:30:26 -0000 2.5.2.2
@@ -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 @@
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']
_______________________________________________
Mailman-checkins mailing list
[email protected]
Unsubscribe:
http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org