We have to know when there is attachment with size 0 and when there is no size (...
authorondrass <ondrass@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 8 Nov 2001 21:05:14 +0000 (21:05 +0000)
committerondrass <ondrass@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 8 Nov 2001 21:05:14 +0000 (21:05 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1707 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index 674896f..d4c61c3 100755 (executable)
@@ -56,11 +56,11 @@ $imap_general_debug = false;
                 flush();
             }
 
-            $size = 0;
+            $size = -1;
             $data[] = $read;
             $read = fgets($imap_stream, 9096);
          } else {
-            $size = 0;
+            $size = -1;
          }
          while (1) {
             while (strpos($read, "\n") === false) {
@@ -95,7 +95,7 @@ $imap_general_debug = false;
                $total_size += strlen($read);
             } else {
                if (ereg("^$pre (OK|BAD|NO)(.*)", $read, $regs) ||
-                   ereg("^\\* [0-9]+ FETCH.*", $read, $regs)) {
+                   (($size == -1) && ereg("^\\* [0-9]+ FETCH.*", $read, $regs))) {
                   break;
                } else {
                   $data[] = $read;