From e83b307d1d9a14e3c8ebbc8d177766e06d2bcda9 Mon Sep 17 00:00:00 2001 From: Rantaharju Jarno Date: Thu, 8 Feb 2024 08:03:23 +0200 Subject: [PATCH] Bugfix for email --- niimpy/reading/email.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/niimpy/reading/email.py b/niimpy/reading/email.py index 7f7adaba..c5455a00 100644 --- a/niimpy/reading/email.py +++ b/niimpy/reading/email.py @@ -55,13 +55,13 @@ def messages(self): lines = [line] lines.append(line) - + # Handle last message if lines: if isinstance(lines[0], bytes): message = email.message_from_bytes(b''.join(lines)) else: - message = email.message_from_bytes(b''.join(lines)) + message = email.message_from_string(b''.join(lines)) yield(message) def close(self):