From 8a5ec96d79add1d30e3ecf2bd60dc71712b36076 Mon Sep 17 00:00:00 2001 From: David Baer Date: Mon, 4 Oct 2021 21:34:53 -0400 Subject: [PATCH] Fix bug where no content-type is provided in a message part --- dmarcreceiver/commands.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dmarcreceiver/commands.py b/dmarcreceiver/commands.py index 4aee49d..48668df 100644 --- a/dmarcreceiver/commands.py +++ b/dmarcreceiver/commands.py @@ -122,6 +122,10 @@ def receive_report(args): for part in msg.walk(): # check for zip file content_type = part['content-type'] + + if content_type is None: + continue + if content_type.find(';') != -1: content_type = content_type.split(';',1)[0]