Update of /cvsroot/mailman/mailman/Mailman
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15560

Modified Files:
      Tag: Release_2_1-maint
        Deliverer.py 
Log Message:
sendProbe(): Method implementing the actual sending of the probe message to a
member whose bounce score is greater than the threshold.


Index: Deliverer.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Deliverer.py,v
retrieving revision 2.22.2.1
retrieving revision 2.22.2.2
diff -u -d -r2.22.2.1 -r2.22.2.2
--- Deliverer.py        31 Mar 2003 21:49:35 -0000      2.22.2.1
+++ Deliverer.py        10 Feb 2004 22:42:23 -0000      2.22.2.2
@@ -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 Utils
 from Mailman import Message
 from Mailman import i18n
+from Mailman import Pending
 from Mailman.Logging.Syslog import syslog
 
 _ = i18n._
@@ -181,3 +182,40 @@
             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 = '[EMAIL PROTECTED]' % ((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)


_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to