patch adds options that allow setting max size of fetched message body
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 15 Oct 2003 16:24:36 +0000 (16:24 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 15 Oct 2003 16:24:36 +0000 (16:24 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@5939 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index fe3041510e1e2ac72b290953c61745d9828d8408..e8538eb918fb79c9ed0427c72edbc271742ee85a 100644 (file)
@@ -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));