From b76fa539c4e8eb6b2d9bb6f34841c7c21b52e498 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 23 Sep 2009 11:03:59 -0400 Subject: [PATCH] Added normalize_email_address() to be-mbox-to-xml --- interfaces/xml/be-mbox-to-xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/interfaces/xml/be-mbox-to-xml b/interfaces/xml/be-mbox-to-xml index 9e5c4e6..338982e 100755 --- a/interfaces/xml/be-mbox-to-xml +++ b/interfaces/xml/be-mbox-to-xml @@ -35,13 +35,16 @@ set_IO_stream_encodings(DEFAULT_ENCODING) KNOWN_IDS = [] +def normalize_email_address(address): + return email.utils.formataddr(email.utils.parseaddr(address)) + def comment_message_to_xml(message, fields=None): if fields == None: fields = {} new_fields = {} new_fields[u'alt-id'] = message[u'message-id'] new_fields[u'in-reply-to'] = message[u'in-reply-to'] - new_fields[u'author'] = message[u'from'] + new_fields[u'author'] = normalize_email_address(message[u'from']) new_fields[u'date'] = message[u'date'] new_fields[u'content-type'] = message.get_content_type() for k,v in new_fields.items(): -- 2.26.2