summaryrefslogtreecommitdiff
path: root/program/steps/mail/get.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-06-08 11:49:12 +0200
committerAleksander Machniak <alec@alec.pl>2012-06-08 11:49:12 +0200
commit4fd5b62194c37cf296d3f9c8babfb14f897c2d93 (patch)
tree73323f36ad8bbbd8c68b3b2a3b9fab11bc3de1f2 /program/steps/mail/get.inc
parent8749e94b4bed36500e4f45c65cc16cfd5633ef34 (diff)
Add Content-Length for attachments where possible (#1485478)
Diffstat (limited to 'program/steps/mail/get.inc')
-rw-r--r--program/steps/mail/get.inc7
1 files changed, 6 insertions, 1 deletions
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc
index 658538a20..bcd57dee0 100644
--- a/program/steps/mail/get.inc
+++ b/program/steps/mail/get.inc
@@ -199,13 +199,18 @@ else if (strlen($pid = get_input_value('_part', RCUBE_INPUT_GET))) {
$sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout);
}
}
+ // send part as-it-is
else {
- // turn off output buffering and print part content
if ($part->body) {
+ header("Content-Length: " . sizeof($part->body));
echo $part->body;
$sent = true;
}
else if ($part->size) {
+ if ($size = (int)$part->d_parameters['size']) {
+ header("Content-Length: $size");
+ }
+
$sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true);
}
}