diff options
| author | bwarsaw | 2001-08-17 21:20:58 +0000 |
|---|---|---|
| committer | bwarsaw | 2001-08-17 21:20:58 +0000 |
| commit | 7c90b0018a16db6fc46fcda2807ec2069b9415b4 (patch) | |
| tree | 2c0e210c0c4c684338b4d762222abb5e16231f70 | |
| parent | 5d9e3c622c3715030d4cf1c6181e9daf07ef7d56 (diff) | |
| download | mailman-7c90b0018a16db6fc46fcda2807ec2069b9415b4.tar.gz mailman-7c90b0018a16db6fc46fcda2807ec2069b9415b4.tar.zst mailman-7c90b0018a16db6fc46fcda2807ec2069b9415b4.zip | |
Process(): When personalizing regular deliveries, set the To: header
to point at the recipient instead of the list.
| -rw-r--r-- | Mailman/Handlers/Personalize.py | 13 |
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'] |
