From 3fe444e5aa5ce55a0f51adf30281790b2172ef91 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Sun, 12 May 2019 13:34:56 +0200 Subject: [PATCH] Only send the filename --- mailcap-client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailcap-client.py b/mailcap-client.py index 68be397..970762e 100644 --- a/mailcap-client.py +++ b/mailcap-client.py @@ -19,4 +19,4 @@ data = open(filename, "rb").read() def strtr(x, c="B"): return struct.pack(c, len(x)) + x -s.sendall(strtr(filename.encode('utf-8')) + strtr(mime.encode('utf-8')) + strtr(data, "!I")) +s.sendall(strtr(filename.split(os.pathsep)[-1].encode('utf-8')) + strtr(mime.encode('utf-8')) + strtr(data, "!I"))