diff --git a/include/class.mailfetch.php b/include/class.mailfetch.php
index 0b739e7c82eeb4a9a1668a096effcbc8ade8616e..b4156ce7afdea3300e50975b08c65722157b1edf 100644
--- a/include/class.mailfetch.php
+++ b/include/class.mailfetch.php
@@ -655,6 +655,7 @@ class MailFetcher {
                     $attachments[] = array(
                         'cid' => @$at->AttachContentId ?: false,
                         'data' => $at,
+                        'size' => @$at->DataSize ?: null,
                         'type' => @$at->AttachMimeTag ?: false,
                         'name' => $at->getName(),
                     );
diff --git a/include/class.mailparse.php b/include/class.mailparse.php
index 378c68c1959e2a5c6ff4d442a9b8282c43c7aee3..a17890c173818990665c14a77d00bbfcd1dd6c00 100644
--- a/include/class.mailparse.php
+++ b/include/class.mailparse.php
@@ -418,6 +418,7 @@ class Mail_Parse {
                 $files[] = array(
                     'cid' => @$at->AttachContentId ?: false,
                     'data' => $at->getData(),
+                    'size' => @$at->DataSize ?: null,
                     'type' => @$at->AttachMimeTag ?: false,
                     'name' => $at->getName(),
                 );
diff --git a/include/tnef_decoder.php b/include/tnef_decoder.php
index 45ee5b5c074db014d98e69af2c2238697c550820..e0f7869ba82b4ce554ada486efbfb1ae9cc4bb67 100644
--- a/include/tnef_decoder.php
+++ b/include/tnef_decoder.php
@@ -491,6 +491,7 @@ class TnefStreamParser {
                 break;
             case self::attAttachData:
                 $attach->_setData($info['data']);
+                $attach->_setDataSize($info['length']);
                 break;
             }
         }
@@ -557,6 +558,10 @@ class TnefAttachment extends AbstractTnefObject {
         $this->Data = $data;
     }
 
+    function _setDataSize($size) {
+        $this->DataSize = $size;
+    }
+
     function getData() {
         if (isset($this->Data))
             return $this->Data;