summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-11-19 14:33:35 +0000
committeralecpl <alec@alec.pl>2008-11-19 14:33:35 +0000
commitceb52fe07476f9584e0ffe3d5937b47d087a145e (patch)
tree4d2f6edfe1df503d9e3b74840d77b1dfa16c4341
parent3e20c4b31d25a84549db59d670980da149c111d0 (diff)
- Fix handling of some malformed messages (#1484438)
-rw-r--r--CHANGELOG4
-rw-r--r--program/lib/imap.inc26
2 files changed, 8 insertions, 22 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b7e236d16..8a6379253 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,10 @@
CHANGELOG RoundCube Webmail
---------------------------
+2008/11/19 (alec)
+----------
+- Fix handling of some malformed messages (#1484438)
+
2008/11/15 (alec)
----------
- Fix big memory consumption and speed up searching on servers without SORT capability
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index fb971db68..316980ca5 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -70,6 +70,7 @@
- fixed iil_C_Sort() to support very long and/or divided responses
- added BYE response simple support for endless loop prevention
- added 3rd argument in iil_StartsWith* functions
+ - fix iil_C_FetchPartHeader() in some cases by use of iil_C_HandlePartBody()
********************************************************/
@@ -2368,33 +2369,14 @@ function iil_C_UnSubscribe(&$conn, $folder) {
}
function iil_C_FetchPartHeader(&$conn, $mailbox, $id, $part) {
- $fp = $conn->fp;
- $result = false;
- if (($part == 0) || (empty($part))) {
+
+ if (empty($part)) {
$part = 'HEADER';
} else {
$part .= '.MIME';
}
- if (iil_C_Select($conn, $mailbox)) {
- $key = 'fh' . ($c++);
- $request = $key . " FETCH $id (BODY.PEEK[$part])";
- if (!iil_PutLine($fp, $request)) return false;
- do {
- $line = chop(iil_ReadLine($fp, 200));
- $a = explode(' ', $line);
- if (($line[0] == '*') && ($a[2] == 'FETCH')
- && ($line[strlen($line)-1] != ')')) {
- $line=iil_ReadLine($fp, 300);
- while (trim($line) != ')') {
- $result .= $line;
- $line=iil_ReadLine($fp, 300);
- }
- }
- } while (strcmp($a[0], $key) != 0 && ($a[0] != '*' || $a[1] != 'BYE'));
- }
-
- return $result;
+ return iil_C_HandlePartBody(&$conn, $mailbox, $id, $part, 1);
}
function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part, $mode, $file=NULL) {