From 76c07f6d490ae01bb5610185f22b546fca9c06ea Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Wed, 11 Mar 2020 11:56:15 +0100 Subject: [PATCH] remail/mail: Add missing encrypted.asc filename Assuming that there is a limited number of possible filenames is just wrong. Add yet another one. Signed-off-by: Thomas Gleixner --- remail/mail.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/remail/mail.py b/remail/mail.py index 03a8a93..92ee364 100644 --- a/remail/mail.py +++ b/remail/mail.py @@ -367,7 +367,7 @@ def msg_sanitize_outlook(msg): # Try to find the payload part which actually contains the # magically wrapped outlook GPG data. # Two variants: - # 1) msg.asc or msc.gpg provided as a plain attachement + # 1) random filenames provided as a plain attachement # without PGP envelope # 2) GpgOL_MIME_structure.txt contains a fully enveloped # PGP payload with the proper headers. @@ -377,8 +377,11 @@ def msg_sanitize_outlook(msg): if payload.get_content_type() != 'application/octet-stream': continue + fnames = ['msg.gpg', 'msg.asc', 'encrypted.asc', + 'GpgOL_MIME_structure.txt'] + fname = payload.get_filename(None) - if fname not in ['msg.gpg', 'msg.asc', 'GpgOL_MIME_structure.txt']: + if fname not in fnames: continue decode_base64(payload)