summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mailman/Handlers/Personalize.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Mailman/Handlers/Personalize.py b/Mailman/Handlers/Personalize.py
index 52add3783..a7a73e6c0 100644
--- a/Mailman/Handlers/Personalize.py
+++ b/Mailman/Handlers/Personalize.py
@@ -32,13 +32,26 @@ def process(mlist, msg, msgdata):
newpipeline = ['Decorate', 'ToOutgoing']
inq = get_switchboard(mm_cfg.INQUEUE_DIR)
+ # Save the original To: line
+ originalto = msg['To']
+
for member in msgdata.get('recips', []):
metadatacopy = msgdata.copy()
metadatacopy['pipeline'] = newpipeline
metadatacopy['recips'] = [member]
metadatacopy['personalized'] = 1
+ del msg['To']
+ name = mlist.getMemberName(member)
+ if name:
+ msg['To'] = '%s (%s)' % (member, name)
+ else:
+ msg['To'] = member
inq.enqueue(msg, metadatacopy, listname=mlist.internal_name())
+ # Restore the original To: line
+ del msg['To']
+ msg['To'] = originalto
+
# Don't let the normal ToOutgoing processing actually send the original
# copy.
del msgdata['recips']