From ad306ad0e95a2265161e7c4f4062c70fb2b259a5 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Fri, 10 May 2019 23:31:38 +0200 Subject: [PATCH] Improve mime type handling --- mailcap-server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mailcap-server.py b/mailcap-server.py index 1e6c5e4..78076cc 100644 --- a/mailcap-server.py +++ b/mailcap-server.py @@ -112,8 +112,8 @@ if __name__ == "__main__": if rv: f, mime = rv print(f, mime) - match = mailcap.findmatch(caps, mime, filename=f) - if match: + match = mailcap.findmatch(caps, mime.split(';')[0], filename=f) + if match and match[0]: os.system(match[0]) if 'nodelete' not in match[1]: os.remove(f)