summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter
diff options
context:
space:
mode:
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r--service/pixelated/adapter/mailstore/leap_mailstore.py2
-rw-r--r--service/pixelated/adapter/model/mail.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/service/pixelated/adapter/mailstore/leap_mailstore.py b/service/pixelated/adapter/mailstore/leap_mailstore.py
index 3539b498..d550ec60 100644
--- a/service/pixelated/adapter/mailstore/leap_mailstore.py
+++ b/service/pixelated/adapter/mailstore/leap_mailstore.py
@@ -34,7 +34,7 @@ class AttachmentInfo(object):
self.name = _extract_filename(headers)
self.encoding = headers.get('Content-Transfer-Encoding', None)
self.ctype = part_map.get('ctype') or headers.get('Content-Type')
- self.size = headers.get('size', 0)
+ self.size = part_map.get('size', 0)
def __repr__(self):
return 'AttachmentInfo[%s, %s, %s]' % (self.ident, self.name, self.encoding)
diff --git a/service/pixelated/adapter/model/mail.py b/service/pixelated/adapter/model/mail.py
index 1a505481..dd2f4c0d 100644
--- a/service/pixelated/adapter/model/mail.py
+++ b/service/pixelated/adapter/model/mail.py
@@ -116,7 +116,7 @@ class Mail(object):
attachment_mime = MIMENonMultipart(major, sub)
base64_attachment_file = binascii.b2a_base64(attachment['raw'])
attachment_mime.set_payload(base64_attachment_file)
- attachment_mime['Content-Disposition'] = 'attachment; filename="%s"' % attachment['filename']
+ attachment_mime['Content-Disposition'] = 'attachment; filename="%s"' % attachment['name']
attachment_mime['Content-Transfer-Encoding'] = 'base64'
mime.attach(attachment_mime)