From: Nicolas Iooss Date: Sun, 21 Jul 2013 19:57:22 +0000 (+0200) Subject: NL bounces: fix findAddressInBounce() X-Git-Tag: xorg/1.1.9~15 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4aad6c9c0d06bcaedf17ea3d09e3667e388750cd;p=platal.git NL bounces: fix findAddressInBounce() Signed-off-by: Nicolas Iooss --- diff --git a/bin/newsletter.bounces.processor.py b/bin/newsletter.bounces.processor.py index 46d8a18..485e855 100755 --- a/bin/newsletter.bounces.processor.py +++ b/bin/newsletter.bounces.processor.py @@ -142,7 +142,7 @@ def findAddressInBounce(bounce): return None status = bounce.get_payload(1) if status.get_content_type() != 'message/delivery-status': - print('! Not a valid bounce (expected message/delivery-status, found %s).' % bounce.get_content_type()) + print('! Not a valid bounce (expected message/delivery-status, found %s).' % status.get_content_type()) return None # The per-message-fields don't matter here, get only the per-recipient-fields num_payloads = len(status.get_payload()) @@ -151,7 +151,7 @@ def findAddressInBounce(bounce): return None content = status.get_payload(1) if content.get_content_type() != 'text/plain': - print('! Not a valid bounce (expected text/plain, found %s).' % bounce.get_content_type) + print('! Not a valid bounce (expected text/plain, found %s).' % content.get_content_type()) return None # Extract the faulty email address recipient_match = _recipient_re.search(content['Final-Recipient']) @@ -160,7 +160,7 @@ def findAddressInBounce(bounce): return None email = recipient_match.group(1) # Check the action field - if content['Action'] != 'failed': + if content['Action'].lower() != 'failed': print('! Not a failed action (%s).' % content['Action']) return None # Mail forwarding loops, DNS errors and connection timeouts cause X-Postfix errors