From: Nicolas Iooss Date: Sun, 26 Jan 2014 19:16:29 +0000 (+0100) Subject: NL bounces: no longer crash on messages without a From header X-Git-Tag: xorg/1.1.12~46 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6c4ff6f1fbe38b1caf17215d23f1259e5f001d87;p=platal.git NL bounces: no longer crash on messages without a From header Signed-off-by: Nicolas Iooss --- 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: