From 73fac36c800625ab956c3562c17743ee85177c8d Mon Sep 17 00:00:00 2001 From: Alfredo Date: Wed, 22 May 2019 12:21:36 +0200 Subject: [PATCH] Check for ATTACH_LONG_FILENAME before ATTACH_FILENAME (#7) --- outlookmsgfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outlookmsgfile.py b/outlookmsgfile.py index 44d7b56..5d86c28 100644 --- a/outlookmsgfile.py +++ b/outlookmsgfile.py @@ -148,7 +148,7 @@ def process_attachment(msg, entry, doc): blob = props['ATTACH_DATA_BIN'] # Get the filename and MIME type of the attachment. - filename = props.get("ATTACH_FILENAME") or props.get("DISPLAY_NAME") + filename = props.get("ATTACH_LONG_FILENAME") or props.get("ATTACH_FILENAME") or props.get("DISPLAY_NAME") if isinstance(filename, bytes): filename = filename.decode("utf8") mime_type = props.get('ATTACH_MIME_TAG', 'application/octet-stream')