Commit 556bd364 authored by Kevin Deldycke's avatar Kevin Deldycke

Fix bugs.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5953 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2ae2f821
...@@ -81,20 +81,20 @@ class MailMessage(XMLObject, Event, CMFMailInMessage): ...@@ -81,20 +81,20 @@ class MailMessage(XMLObject, Event, CMFMailInMessage):
) )
def __init__(self, *args, **kw): def __init__(self, *args, **kw):
kw = self.cleanIncomingMessage(**kw)
XMLObject.__init__(self, *args, **kw) XMLObject.__init__(self, *args, **kw)
self.attachments = attachments
def _edit(self, *args, **kw): def _edit(self, *args, **kw):
# LOG('MailMessage._edit', 0, str(kw)) LOG('MailMessage._edit', 0, str(kw))
self._cleanIncomingMessage(**kw) kw = self.cleanIncomingMessage(**kw)
XMLObject._edit(self, *args, **kw) XMLObject._edit(self, *args, **kw)
self.attachments = attachments
def _cleanIncomingMessage(**kw): def cleanIncomingMessage(self, **kw):
# Delete attachments # Delete attachments
attachments = kw.get('attachments', {}) attachments = kw.get('attachments', {})
if kw.has_key('attachments'): if kw.has_key('attachments'):
del kw['attachments'] del kw['attachments']
self.attachments = attachments
# Decode MIME base64/32/16 data # Decode MIME base64/32/16 data
if kw.has_key('header') and kw['header'].has_key('content-transfer-encoding'): if kw.has_key('header') and kw['header'].has_key('content-transfer-encoding'):
content_encoding = kw['header']['content-transfer-encoding'] content_encoding = kw['header']['content-transfer-encoding']
...@@ -102,6 +102,7 @@ class MailMessage(XMLObject, Event, CMFMailInMessage): ...@@ -102,6 +102,7 @@ class MailMessage(XMLObject, Event, CMFMailInMessage):
method = supported_encoding[content_encoding] method = supported_encoding[content_encoding]
kw['body'] = method(kw['body']) kw['body'] = method(kw['body'])
del kw['header']['content-transfer-encoding'] del kw['header']['content-transfer-encoding']
return kw
def send(self, from_url=None, to_url=None, msg=None, subject=None): def send(self, from_url=None, to_url=None, msg=None, subject=None):
""" """
......
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