| | |
| | | } |
| | | |
| | | stream_set_timeout($conn->fp, 10); |
| | | $line = stream_get_line($conn->fp, 8192, "\r\n"); |
| | | $line = stream_get_line($conn->fp, 8192, "\n"); |
| | | |
| | | if ($my_prefs['debug_mode'] && $line) |
| | | write_log('imap', 'S: '. $line); |
| | |
| | | if($bodystr) { |
| | | while (!preg_match('/ BODYSTRUCTURE (.*) BODY\[HEADER.FIELDS/s', $line, $m)) { |
| | | $line2 = iil_ReadLine($fp, 1024); |
| | | $line .= iil_MultLine($fp, $line2); |
| | | $line .= iil_MultLine($fp, $line2, true); |
| | | } |
| | | $result[$id]->body_structure = $m[1]; |
| | | } |
| | |
| | | preg_match('/ BODY\[HEADER.FIELDS \(.*?\)\]\s*(.*)$/s', $line, $m); |
| | | $reslines = explode("\n", trim($m[1], '"')); |
| | | // re-parse (see below) |
| | | foreach ($reslines as $line) { |
| | | if (ord($line[0])<=32) { |
| | | $lines[$ln] .= (empty($lines[$ln])?'':"\n").trim($line); |
| | | foreach ($reslines as $resln) { |
| | | if (ord($resln[0])<=32) { |
| | | $lines[$ln] .= (empty($lines[$ln])?'':"\n").trim($resln); |
| | | } else { |
| | | $lines[++$ln] = trim($line); |
| | | $lines[++$ln] = trim($resln); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | } while (strcmp($a[0], $key) != 0); |
| | | } while (!iil_StartsWith($line, $key, true)); |
| | | |
| | | return $result; |
| | | } |
| | |
| | | if (iil_PutLine($fp, $key . ($is_uid ? ' UID' : '') ." FETCH $id (BODYSTRUCTURE)")) { |
| | | do { |
| | | $line = iil_ReadLine($fp, 5000); |
| | | $line = iil_MultLine($fp, $line); |
| | | $line = iil_MultLine($fp, $line, true); |
| | | if (!preg_match("/^$key/", $line)) |
| | | $result .= $line; |
| | | } while (!iil_StartsWith($line, $key, true)); |