about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2022-01-11 22:22:26 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2022-01-11 22:22:26 +0700
commit76f60ec2bda8670435a00cb2eb857f2f1018177d (patch)
tree53f218dbc88ab1a94225fa2610859a3c119439d4 /src
parent03c249a5326f412dc63b4f5a5465ea80fd822dda (diff)
downloadformbox-76f60ec2bda8670435a00cb2eb857f2f1018177d.tar.gz
Fix author name extraction
Diffstat (limited to 'src')
-rw-r--r--src/formbox.py6
1 files 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))),