Aleksander Machniak
2015-09-10 969547784e0aa96091467bf358cec3b3f06d3df1
program/steps/mail/get.inc
@@ -247,7 +247,7 @@
            if (!rcube_utils::mem_check($part->size * 10)) {
                $out = '<body>' . $RCMAIL->gettext('messagetoobig'). ' '
                    . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id
                        .'&_mbox='. urlencode($RCMAIL->storage->get_folder()), $RCMAIL->gettext('download')) . '</body></html>';
                        .'&_mbox='. urlencode($MESSAGE->folder), $RCMAIL->gettext('download')) . '</body></html>';
            }
            else {
                // get part body if not available
@@ -356,15 +356,15 @@
            }
            // send part as-it-is
            else {
                if ($part->body && empty($plugin['download'])) {
                // here we trust attachments from TNEF/uuencode message are untouched (#1490091)
                if ($part->body && (!is_numeric($part->mime_id) || empty($plugin['download']))) {
                    header("Content-Length: " . strlen($part->body));
                    echo $part->body;
                    $sent = true;
                }
                else if ($part->size) {
                    if ($size = (int)$part->d_parameters['size']) {
                        header("Content-Length: $size");
                    }
                    // Don't be tempted to set Content-Length to $part->d_parameters['size'] (#1490482)
                    // RFC2183 says "The size parameter indicates an approximate size"
                    // 8th argument disables re-formatting of text/* parts (#1489267)
                    $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true, null, false, 0, false);