diff options
-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) |