NL bounces: add another case to DSN filter
authorNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Tue, 20 Aug 2013 17:01:37 +0000 (19:01 +0200)
committerNicolas Iooss <nicolas.iooss_git@polytechnique.org>
Sat, 21 Sep 2013 15:20:36 +0000 (17:20 +0200)
Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
bin/newsletter.bounces.processor.py

index b17d945..7cb0d74 100755 (executable)
@@ -466,8 +466,8 @@ class DeliveryStatusNotificationFilter(MboxFilter):
             return True
 
         # Detect ill-formatted reports, sent as plain text email
-        if 'MAILER-DAEMON@' in message['From'].upper():
-            email = findAddressInPlainBounce(message)
+        if 'MAILER-DAEMON@' in message['From'].upper() and report_message.get_content_type() == 'text/plain':
+            email = findAddressInPlainBounce(report_message)
             if email is not None:
                 self.emails.append(email)
                 self.mbox.add(message)