diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2022-01-11 22:22:26 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2022-01-11 22:22:26 +0700 |
commit | 76f60ec2bda8670435a00cb2eb857f2f1018177d (patch) | |
tree | 53f218dbc88ab1a94225fa2610859a3c119439d4 | |
parent | 03c249a5326f412dc63b4f5a5465ea80fd822dda (diff) | |
download | formbox-76f60ec2bda8670435a00cb2eb857f2f1018177d.tar.gz |
Fix author name extraction
-rw-r--r-- | src/formbox.py | 6 |
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))), |