From 231a921d5cece9eafc1cf67bdd335a03672eef8f Mon Sep 17 00:00:00 2001 From: Sean Whalen Date: Thu, 11 Oct 2018 13:36:39 -0400 Subject: [PATCH] More refactoring fixes --- parsedmarc/utils.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/parsedmarc/utils.py b/parsedmarc/utils.py index 4bea71a..b86cefc 100644 --- a/parsedmarc/utils.py +++ b/parsedmarc/utils.py @@ -325,9 +325,18 @@ def get_filename_safe_string(string): return string -def is_outlook_msg(suspect_bytes): - """Checks if the given content is a Outlook msg OLE file""" - return suspect_bytes.startswith(b"\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1") +def is_outlook_msg(content): + """ + Checks if the given content is a Outlook msg OLE file + + Args: + content: Content to check + + Returns: + bool: A flag the indicates if a file is a Outlook MSG file + """ + return type(content) == bytes and content.startswith( + b"\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1") def convert_outlook_msg(msg_bytes):