From 4d592352b16c63c5ede7ffcc51d78fb011a82601 Mon Sep 17 00:00:00 2001 From: tokul Date: Wed, 15 Oct 2003 16:24:36 +0000 Subject: [PATCH] patch adds options that allow setting max size of fetched message body git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5939 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/mime.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/mime.php b/functions/mime.php index fe304151..e8538eb9 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -92,7 +92,7 @@ function mime_structure ($bodystructure, $flags=array()) { * to mime_get_elements() */ -function mime_fetch_body($imap_stream, $id, $ent_id=1) { +function mime_fetch_body($imap_stream, $id, $ent_id=1, $fetch_size=0) { global $uid_support; /* Do a bit of error correction. If we couldn't find the entity id, just guess * that it is the first one. That is usually the case anyway. @@ -104,6 +104,8 @@ function mime_fetch_body($imap_stream, $id, $ent_id=1) { $cmd = "FETCH $id BODY[$ent_id]"; } + if ($fetch_size!=0) $cmd .= "<0.$fetch_size>"; + $data = sqimap_run_command ($imap_stream, $cmd, true, $response, $message, $uid_support); do { $topline = trim(array_shift($data)); -- 2.25.1