deal with empty sender name field

workspace
Brendan Howell 7 years ago
parent 98efd00228
commit c8b47ec336

@ -303,6 +303,8 @@ class MailRoom(Bureau):
msg.msgid = str(msgid) msg.msgid = str(msgid)
sender = envelope.from_[0] sender = envelope.from_[0]
if sender.name is None:
sender.name = b""
msg.fromaddr = sender.mailbox + b"@" + sender.host msg.fromaddr = sender.mailbox + b"@" + sender.host
msg.fromaddr = clean_header(msg.fromaddr.decode("utf-8")) msg.fromaddr = clean_header(msg.fromaddr.decode("utf-8"))
msg.fromname = clean_header(sender.name.decode("utf-8")) msg.fromname = clean_header(sender.name.decode("utf-8"))

Loading…
Cancel
Save