aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Sapiro <mark@msapiro.net>2019-05-16 18:42:19 -0700
committerMark Sapiro <mark@msapiro.net>2019-05-16 18:42:19 -0700
commit29e9b5c67b1b9b1a1da73e27c1617e5f467805af (patch)
tree9de3e908d6e889edce8b858500f3143b782a48b4
parentccc55497603d5079bd2f95045f42a26a351811c6 (diff)
downloadmailman2-29e9b5c67b1b9b1a1da73e27c1617e5f467805af.tar.gz
mailman2-29e9b5c67b1b9b1a1da73e27c1617e5f467805af.tar.xz
mailman2-29e9b5c67b1b9b1a1da73e27c1617e5f467805af.zip
Remove unnecessary kludges from DSN recognition.
-rw-r--r--Mailman/Bouncers/DSN.py28
1 files changed, 1 insertions, 27 deletions
diff --git a/Mailman/Bouncers/DSN.py b/Mailman/Bouncers/DSN.py
index b316c696..06edc5b0 100644
--- a/Mailman/Bouncers/DSN.py
+++ b/Mailman/Bouncers/DSN.py
@@ -35,7 +35,7 @@ except NameError:
-def check(msg):
+def process(msg):
# Iterate over each message/delivery-status subpart
addrs = []
for part in typed_subpart_iterator(msg, 'message', 'delivery-status'):
@@ -86,29 +86,3 @@ def check(msg):
realname, a = parseaddr(a)
rtnaddrs[a] = True
return rtnaddrs.keys()
-
-
-
-def process(msg):
- # We've seen some fairly bogus DSNs, allegedly from postfix that are
- # multipart/mixed with 3 subparts - a text/plain postfix like part, a
- # message/delivery-status part and a message/rfc822 part with the original
- # message. Deal with it as follows.
- if (msg.is_multipart() and len(msg.get_payload()) == 3 and
- msg.get_payload()[1].get_content_type() == 'message/delivery-status'):
- return check(msg.get_payload()[1])
- # A DSN has been seen wrapped with a "legal disclaimer" by an outgoing MTA
- # in a multipart/mixed outer part.
- if msg.is_multipart() and msg.get_content_subtype() == 'mixed':
- msg = msg.get_payload()[0]
- # The above will suffice if the original message 'parts' were wrapped with
- # the disclaimer added, but the original DSN can be wrapped as a
- # message/rfc822 part. We need to test that too.
- if msg.is_multipart() and msg.get_content_type() == 'message/rfc822':
- msg = msg.get_payload()[0]
- # The report-type parameter should be "delivery-status", but it seems that
- # some DSN generating MTAs don't include this on the Content-Type: header,
- # so let's relax the test a bit.
- if not msg.is_multipart() or msg.get_content_subtype() <> 'report':
- return None
- return check(msg)