Check for ATTACH_LONG_FILENAME before ATTACH_FILENAME (#7)

This commit is contained in:
Alfredo
2019-05-22 12:21:36 +02:00
committed by Joshua Tauberer
parent eee84c759f
commit 73fac36c80
+1 -1
View File
@@ -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')