diff --git a/helpdesk/email.py b/helpdesk/email.py index 58a666f9..15e27f54 100644 --- a/helpdesk/email.py +++ b/helpdesk/email.py @@ -687,8 +687,7 @@ def extract_part_data( name = f"part-{counter}{ext}" else: name = f"part-{counter}_{name}" - payload = decodeUnknown(part.get_charset(), part.as_bytes( - )) if part.is_multipart() else part.get_payload(decode=True) + payload = part.as_string() if part.is_multipart() else part.get_payload(decode=True) files.append(SimpleUploadedFile(name, payload, mimetypes.guess_type(name)[0])) logger.debug("Found MIME attachment %s", name) return part_body, part_full_body