From 76f60ec2bda8670435a00cb2eb857f2f1018177d Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Tue, 11 Jan 2022 22:22:26 +0700 Subject: Fix author name extraction --- src/formbox.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/formbox.py b/src/formbox.py index 776b3e0..5e30faf 100644 --- a/src/formbox.py +++ b/src/formbox.py @@ -74,10 +74,8 @@ def render(template, archive, parent): body = get_body(self) if body is None: continue message_id = self['Message-Id'] - try: - author, address = decode(self['From']) - except ValueError: - author = self['From'] + # Please don't have space in email addresses + author = ' '.join(decode(self['From'])).rsplit(maxsplit=1)[0] rendered_children = render(template, archive, message_id) yield template.format(message_id=quote(message_id), mailto_params=urlencode(dict(reply_to(self))), -- cgit 1.4.1