aboutsummaryrefslogtreecommitdiffstats
path: root/interfaces/xml
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-09-23 11:03:59 -0400
committerW. Trevor King <wking@drexel.edu>2009-09-23 11:03:59 -0400
commitb76fa539c4e8eb6b2d9bb6f34841c7c21b52e498 (patch)
tree1531001b841f259bfe945debbc9fad564d3ff956 /interfaces/xml
parent868122d0b9076b4ffbedf50d2bff491f0493e8c0 (diff)
downloadbugseverywhere-b76fa539c4e8eb6b2d9bb6f34841c7c21b52e498.tar.gz
Added normalize_email_address() to be-mbox-to-xml
Diffstat (limited to 'interfaces/xml')
-rwxr-xr-xinterfaces/xml/be-mbox-to-xml5
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():