summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter/mailstore/body_parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'service/pixelated/adapter/mailstore/body_parser.py')
-rw-r--r--service/pixelated/adapter/mailstore/body_parser.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/service/pixelated/adapter/mailstore/body_parser.py b/service/pixelated/adapter/mailstore/body_parser.py
index a632319e..2193b8e8 100644
--- a/service/pixelated/adapter/mailstore/body_parser.py
+++ b/service/pixelated/adapter/mailstore/body_parser.py
@@ -49,13 +49,13 @@ class BodyParser(object):
return parsed_body.get_payload(decode=True)
def _serialize_for_parser(self, charset):
- text = u''
- text += u'Content-Type: %s\n' % self._content_type
+ text = u'Content-Type: %s\n' % self._content_type
if self._content_transfer_encoding is not None:
text += u'Content-Transfer-Encoding: %s\n' % self._content_transfer_encoding
+
text += u'\n'
encoded_text = text.encode(charset)
if isinstance(self._content, unicode):
- return encoded_text + self._content.encode(charset)
+ return encoded_text + self._content.encode(charset, 'ignore')
else:
return encoded_text + self._content