summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbwarsaw2001-08-03 21:55:06 +0000
committerbwarsaw2001-08-03 21:55:06 +0000
commita95717fd40d8f04e651fef04a91f210eab0b713d (patch)
treed41fca93712e6ab1c2a63a3af378595891ec61b6
parent21df0741efc2ca3a89b9b6c5a924c753c99107dd (diff)
downloadmailman-a95717fd40d8f04e651fef04a91f210eab0b713d.tar.gz
mailman-a95717fd40d8f04e651fef04a91f210eab0b713d.tar.zst
mailman-a95717fd40d8f04e651fef04a91f210eab0b713d.zip
intermediate
-rw-r--r--Mailman/Handlers/Personalize.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/Mailman/Handlers/Personalize.py b/Mailman/Handlers/Personalize.py
new file mode 100644
index 000000000..52add3783
--- /dev/null
+++ b/Mailman/Handlers/Personalize.py
@@ -0,0 +1,44 @@
+# Copyright (C) 2001 by the Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+"""Personalize the email message for delivery to each individual recipient.
+"""
+
+from Mailman import mm_cfg
+from Mailman.Queue.sbcache import get_switchboard
+
+
+
+def process(mlist, msg, msgdata):
+ if not mlist.personalize or msgdata.get('personalized'):
+ return
+ # Make a copy for each recipient, and re-queue the copies to the incoming
+ # queue. Set the pipeline for the copies to just Decorate and
+ # ToOutgoing. The normal queue on the original copy should take care of
+ # everything else.
+ newpipeline = ['Decorate', 'ToOutgoing']
+ inq = get_switchboard(mm_cfg.INQUEUE_DIR)
+
+ for member in msgdata.get('recips', []):
+ metadatacopy = msgdata.copy()
+ metadatacopy['pipeline'] = newpipeline
+ metadatacopy['recips'] = [member]
+ metadatacopy['personalized'] = 1
+ inq.enqueue(msg, metadatacopy, listname=mlist.internal_name())
+
+ # Don't let the normal ToOutgoing processing actually send the original
+ # copy.
+ del msgdata['recips']