From 6c4ff6f1fbe38b1caf17215d23f1259e5f001d87 Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Sun, 26 Jan 2014 20:16:29 +0100 Subject: [PATCH] NL bounces: no longer crash on messages without a From header Signed-off-by: Nicolas Iooss --- bin/newsletter.bounces.processor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/newsletter.bounces.processor.py b/bin/newsletter.bounces.processor.py index e55251a..6546e88 100755 --- a/bin/newsletter.bounces.processor.py +++ b/bin/newsletter.bounces.processor.py @@ -609,8 +609,8 @@ class DeliveryStatusNotificationFilter(MboxFilter): # Detect ill-formatted reports, sent as plain text email if report_message.get_content_type() == 'text/plain' and ( - 'MAILER-DAEMON@' in message['From'].upper() or - 'mail delivery failure' == message['Subject'].lower() + 'MAILER-DAEMON@' in message.get('From', '').upper() or + 'mail delivery failure' == message.get('Subject', '').lower() ): email = findAddressInPlainBounce(report_message) if email is not None: -- 2.1.4