Update of /cvsroot/mailman/mailman/Mailman/Bouncers
In directory sc8-pr-cvs1:/tmp/cvs-serv7102/Mailman/Bouncers

Modified Files:
      Tag: Release_2_1-maint
        DSN.py 
Log Message:
Backporting from the HEAD -- updated bouncers










Index: DSN.py
===================================================================
RCS file: /cvsroot/mailman/mailman/Mailman/Bouncers/DSN.py,v
retrieving revision 2.7.2.1
retrieving revision 2.7.2.2
diff -u -d -r2.7.2.1 -r2.7.2.2
--- DSN.py      31 Mar 2003 21:49:40 -0000      2.7.2.1
+++ DSN.py      22 Sep 2003 02:40:05 -0000      2.7.2.2
@@ -24,6 +24,14 @@
 from email.Utils import parseaddr
 from cStringIO import StringIO
 
+from Mailman.Bouncers.BouncerAPI import Stop
+
+try:
+    True, False
+except NameError:
+    True = 1
+    False = 0
+
 
 
 def check(msg):
@@ -43,21 +51,18 @@
             # that for other purposes :(
             #
             # Also grok out Action so we can do something with that too.
-            action = msgblock.get('action', '')
-            # BAW: Should we treat delayed bounces the same?  Yes, because if
-            # the transient problem clears up, they should get unbounced.  The
-            # other problem is what to do about a DSN that has both delayed
-            # and failed actions in multiple header blocks?  We're not
-            # architected to handle that. ;/
-            if action.lower() not in ('failed', 'failure', 'delayed'):
+            action = msgblock.get('action', '').lower()
+            if action == 'delayed':
+                return Stop
+            if action not in ('failed', 'failure'):
                 # Some non-permanent failure, so ignore this block
                 continue
             params = []
-            foundp = 0
+            foundp = False
             for header in ('original-recipient', 'final-recipient'):
                 for k, v in msgblock.get_params([], header):
                     if k.lower() == 'rfc822':
-                        foundp = 1
+                        foundp = True
                     else:
                         params.append(k)
                 if foundp:
@@ -69,7 +74,7 @@
     for a in addrs:
         if a is not None:
             realname, a = parseaddr(a)
-            rtnaddrs[a] = 1
+            rtnaddrs[a] = True
     return rtnaddrs.keys()
 
 



_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/mailman-checkins

Reply via email to