diff options
author | bwarsaw <> | 2004-02-10 22:42:23 +0000 |
---|---|---|
committer | bwarsaw <> | 2004-02-10 22:42:23 +0000 |
commit | 6acf876c2deffe45b3e250848ee2c8c9bb405f94 (patch) | |
tree | 915608564714115edf97000a89602133154161f2 /Mailman | |
parent | c7e8affb74e2070e6d7f4b150c2d4909bf4f13de (diff) | |
download | mailman2-6acf876c2deffe45b3e250848ee2c8c9bb405f94.tar.gz mailman2-6acf876c2deffe45b3e250848ee2c8c9bb405f94.tar.xz mailman2-6acf876c2deffe45b3e250848ee2c8c9bb405f94.zip |
sendProbe(): Method implementing the actual sending of the probe message to a
member whose bounce score is greater than the threshold.
Diffstat (limited to 'Mailman')
-rw-r--r-- | Mailman/Deliverer.py | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/Mailman/Deliverer.py b/Mailman/Deliverer.py index be5ddfe9..2479c91a 100644 --- a/Mailman/Deliverer.py +++ b/Mailman/Deliverer.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2004 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 @@ -25,6 +25,7 @@ from Mailman import Errors from Mailman import Utils from Mailman import Message from Mailman import i18n +from Mailman import Pending from Mailman.Logging.Syslog import syslog _ = i18n._ @@ -181,3 +182,40 @@ is required."""))) msg.send(mlist) finally: i18n.set_translation(otrans) + + def sendProbe(self, member, msg): + listname = self.real_name + # Put together the substitution dictionary. + d = {'listname': listname, + 'address': member, + 'optionsurl': self.GetOptionsURL(member, absolute=True), + 'password': self.getMemberPassword(member), + 'owneraddr': self.GetOwnerEmail(), + } + text = Utils.maketext('probe.txt', d, + lang=self.getMemberLanguage(member), + mlist=self) + # Calculate the VERP'd sender address for bounce processing of the + # probe message. + token = self.pend_new(Pending.PROBE_BOUNCE, member, msg) + probedict = { + 'bounces': self.internal_name() + '-bounces', + 'token': token, + } + probeaddr = '%s@%s' % ((mm_cfg.VERP_PROBE_FORMAT % probedict), + self.host_name) + # Calculate the Subject header, in the member's preferred language + ulang = self.getMemberLanguage(member) + otrans = i18n.get_translation() + i18n.set_language(ulang) + try: + subject = _('%(listname)s mailing list probe message') + finally: + i18n.set_translation(otrans) + outer = Message.UserNotification(member, probeaddr, subject) + outer.set_type('multipart/mixed') + text = MIMEText(text, _charset=Utils.GetCharSet(ulang)) + outer.attach(text) + outer.attach(MIMEMessage(msg)) + # Turn off further VERP'ing in the final delivery step + outer.send(self, envsender=probeaddr, verp=False) |