diff options
author | W. Trevor King <wking@drexel.edu> | 2009-09-23 11:03:59 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-09-23 11:03:59 -0400 |
commit | b76fa539c4e8eb6b2d9bb6f34841c7c21b52e498 (patch) | |
tree | 1531001b841f259bfe945debbc9fad564d3ff956 /interfaces/xml | |
parent | 868122d0b9076b4ffbedf50d2bff491f0493e8c0 (diff) | |
download | bugseverywhere-b76fa539c4e8eb6b2d9bb6f34841c7c21b52e498.tar.gz |
Added normalize_email_address() to be-mbox-to-xml
Diffstat (limited to 'interfaces/xml')
-rwxr-xr-x | interfaces/xml/be-mbox-to-xml | 5 |
1 files changed, 4 insertions, 1 deletions
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(): |