git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3056
7612ce4b-ef26-0410-bec9-
ea0150e637f0
$read = trim(substr ($bodystructure, strpos(strtolower($bodystructure), 'bodystructure') + 13));
$msg = &new message();
$read = trim(substr ($read, 0, -1));
$read = trim(substr ($bodystructure, strpos(strtolower($bodystructure), 'bodystructure') + 13));
$msg = &new message();
$read = trim(substr ($read, 0, -1));
$msg = $msg->parseStructure($read,0);
$msg->setEnt('0');
if (count($flags)) {
$msg = $msg->parseStructure($read,0);
$msg->setEnt('0');
if (count($flags)) {
if (!ini_get("safe_mode")) {
set_time_limit(0);
}
if (!ini_get("safe_mode")) {
set_time_limit(0);
}
+ if ($uid_support) {
+ $sid_s = substr($sid,0,strpos($sid, ' '));
+ } else {
+ $sid_s = $sid;
+ }
fputs ($imap_stream, "$sid FETCH $id BODY[$ent_id]\r\n");
$cnt = 0;
$continue = true;
fputs ($imap_stream, "$sid FETCH $id BODY[$ent_id]\r\n");
$cnt = 0;
$continue = true;
- $read = fgets ($imap_stream,4096);
- if (preg_match('/.*\{(\d+)\}.*/',$read,$regs)) {
+ $read = fgets ($imap_stream,8192);
+
+
+// if (preg_match('/.*\{(\d+)\}.*/',$read,$regs)) {
+/*
$size = $regs[1];
$size_div = (int) ($size / 4096);
$size_mod = $size % 4096;
$size = $regs[1];
$size_div = (int) ($size / 4096);
$size_mod = $size % 4096;
if ($size_mod > 0) {
$read .= fread ($imap_stream, $size_mod);
}
if ($size_mod > 0) {
$read .= fread ($imap_stream, $size_mod);
}
- return decodeBody($read, $encoding);
+ echo decodeBody($read, $encoding);
// This could be bad -- if the section has sqimap_session_id() . ' OK'
// or similar, it will kill the download.
// This could be bad -- if the section has sqimap_session_id() . ' OK'
// or similar, it will kill the download.
- while (!ereg("^".$sid." (OK|BAD|NO)(.*)$", $read, $regs)) {
+ while (!ereg("^".$sid_s." (OK|BAD|NO)(.*)$", $read, $regs)) {
if (trim($read) == ')==') {
$read1 = $read;
$read = fgets ($imap_stream,4096);
if (trim($read) == ')==') {
$read1 = $read;
$read = fgets ($imap_stream,4096);
}
$read = fgets ($imap_stream,4096);
$cnt++;
}
$read = fgets ($imap_stream,4096);
$cnt++;
+ if ($message->type0 == 'message' && $message->type1 == 'rfc822') {
+ $message = $message->entities[0];
+ }
$urlmailbox = urlencode($message->mailbox);
$body_message = getEntity($message, $ent_num);
if (($body_message->header->type0 == 'text') ||
$urlmailbox = urlencode($message->mailbox);
$body_message = getEntity($message, $ent_num);
if (($body_message->header->type0 == 'text') ||
$cidurl = str_replace($quotchar, "", $cidurl);
$cidurl = substr(trim($cidurl), 4);
$httpurl = $quotchar . "../src/download.php?absolute_dl=true&" .
$cidurl = str_replace($quotchar, "", $cidurl);
$cidurl = substr(trim($cidurl), 4);
$httpurl = $quotchar . "../src/download.php?absolute_dl=true&" .
- "passed_id=$id&mailbox=" . urlencode($message->header->mailbox) .
+ "passed_id=$id&mailbox=" . urlencode($message->mailbox) .
"&passed_ent_id=" . find_ent_id($cidurl, $message) . $quotchar;
return $httpurl;
}
"&passed_ent_id=" . find_ent_id($cidurl, $message) . $quotchar;
return $httpurl;
}