From 15d7f6407e1c31ce96dc413d921cd244eabd566e Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Tue, 8 Sep 2020 11:10:22 +0200 Subject: [PATCH] fix compatible with mailvelope add name=encrypted.asc --- email_handler.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/email_handler.py b/email_handler.py index b5b59cb7..af4d4869 100644 --- a/email_handler.py +++ b/email_handler.py @@ -379,8 +379,10 @@ def prepare_pgp_message(orig_msg: Message, pgp_fingerprint: str): first.set_payload("Version: 1") msg.attach(first) - second = MIMEApplication("octet-stream", _encoder=encoders.encode_7or8bit) - second.add_header("Content-Disposition", "inline") + second = MIMEApplication( + "octet-stream", _encoder=encoders.encode_7or8bit, name="encrypted.asc" + ) + second.add_header("Content-Disposition", 'inline; filename="encrypted.asc"') # encrypt original message encrypted_data = pgp_utils.encrypt_file( BytesIO(orig_msg.as_bytes()), pgp_fingerprint