From 7c90b0018a16db6fc46fcda2807ec2069b9415b4 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 17 Aug 2001 21:20:58 +0000 Subject: Process(): When personalizing regular deliveries, set the To: header to point at the recipient instead of the list. --- Mailman/Handlers/Personalize.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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'] -- cgit v1.2.3-70-g09d2