From dffaca087fd1f5eb7225910dcbe4e0754e5d33ea Mon Sep 17 00:00:00 2001 From: Jaidyn Levesque <10477760+JadedCtrl@users.noreply.github.com> Date: Wed, 25 Jan 2023 19:25:22 -0600 Subject: [PATCH] Handle strangely-named files --- Maildir.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Maildir.py b/Maildir.py index 80d681c..42be0c9 100755 --- a/Maildir.py +++ b/Maildir.py @@ -89,11 +89,11 @@ class Maildir(GObject.GObject, # Implants e-mail-related attributes into a file's columns def update_file_info(self, file): - if not file.is_mime_type("message/rfc822"): + if file.get_uri_scheme() == 'file' and not file.is_mime_type("message/rfc822"): return - filename = file.get_uri()[7:] - message = email.message_from_file(open(filename)) + filepath = file.get_location().get_path() + message = email.message_from_file(open(filepath)) sender = message.get("From") to = message.get("To")