Commit 9911322d authored by Nicolas Dumazet's avatar Nicolas Dumazet

Add access to rfc822 to allow email parsing


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33513 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 75064b92
......@@ -341,6 +341,16 @@ def getTranslationStringWithContext(self, msg_id, context, context_id):
result = localizer.erp5_ui.gettext(msg_id)
return result.encode('utf8')
from rfc822 import AddressList
def Email_parseAddressHeader(text):
"""
Given a text taken from a From/To/CC/... email header,
return a list of tuples (name, address) extracted from
this header
"""
return AddressList(text).addresslist
#####################################################
# Globals initialization
#####################################################
......
......@@ -135,7 +135,8 @@ allow_module('Products.ERP5Type.Cache')
ModuleSecurityInfo('Products.ERP5Type.Utils').declarePublic(
'sortValueList', 'convertToUpperCase', 'UpperCase',
'convertToMixedCase', 'cartesianProduct', 'sleep', 'getCommonTimeZoneList',
'int2letter', 'getMessageIdWithContext', 'getTranslationStringWithContext')
'int2letter', 'getMessageIdWithContext', 'getTranslationStringWithContext',
'Email_parseAddressHeader')
allow_module('Products.ERP5Type.Message')
ModuleSecurityInfo('Products.ERP5Type.Message').declarePublic('translateString')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment