Changeset 81b573d in github
- Timestamp:
- Sep 16, 2008 4:49:28 AM (5 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- b62b5a0
- Parents:
- cf507b2
- Files:
-
- 5 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_imap.php (modified) (4 diffs)
-
program/include/rcube_message.php (modified) (1 diff)
-
program/lib/imap.inc (modified) (6 diffs)
-
program/steps/mail/compose.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
rf645ce1 r81b573d 1 1 CHANGELOG RoundCube Webmail 2 2 --------------------------- 3 4 2008/09/16 (alec) 5 ---------- 6 - Reduced memory footprint when forwarding attachments (#1485345) 3 7 4 8 2008/09/15 (thomasb) -
program/include/rcube_imap.php
re5686f4 r81b573d 1284 1284 * @param object rcube_message_part Part object created by get_structure() 1285 1285 * @param mixed True to print part, ressource to write part contents in 1286 * @param resource File pointer to save the message part 1286 1287 * @return string Message/part body if not printed 1287 1288 */ 1288 function &get_message_part($uid, $part=1, $o_part=NULL, $print=NULL )1289 function &get_message_part($uid, $part=1, $o_part=NULL, $print=NULL, $fp=NULL) 1289 1290 { 1290 1291 if (!($msg_id = $this->_uid2id($uid))) … … 1294 1295 if (!is_object($o_part)) 1295 1296 { 1297 write_log('errors', 'get_message_part: !is_object'); 1296 1298 $structure_str = iil_C_FetchStructureString($this->conn, $this->mailbox, $msg_id); 1297 1299 $structure = iml_GetRawStructureArray($structure_str); … … 1319 1321 else 1320 1322 { 1321 $body = iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, 1); 1323 if ($fp && $o_part->encoding == 'base64') 1324 return iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, 3, $fp); 1325 else 1326 $body = iil_C_HandlePartBody($this->conn, $this->mailbox, $msg_id, $part, 1); 1322 1327 1323 1328 // decode part body … … 1334 1339 $body = rcube_charset_convert($body, $o_part->charset); 1335 1340 } 1336 } 1337 1341 1342 if ($fp) 1343 { 1344 fwrite($fp, $body); 1345 return true; 1346 } 1347 } 1348 1338 1349 return $body; 1339 1350 } -
program/include/rcube_message.php
r6695db8 r81b573d 118 118 * 119 119 * @param string Part MIME-ID 120 * @param resource File pointer to save the message part 120 121 * @return string Part content 121 122 */ 122 public function get_part_content($mime_id )123 public function get_part_content($mime_id, $fp=NULL) 123 124 { 124 125 if ($part = $this->mime_parts[$mime_id]) 125 return $this->imap->get_message_part($this->uid, $mime_id, $part );126 return $this->imap->get_message_part($this->uid, $mime_id, $part, NULL, $fp); 126 127 else 127 128 return null; -
program/lib/imap.inc
r109314c r81b573d 66 66 optional resposne in iil_Connect(), added iil_C_GetCapability() 67 67 - remove 'undisclosed-recipients' string from 'To' header 68 - iil_C_HandlePartBody(): added 6th argument and fixed endless loop 68 69 69 70 ********************************************************/ … … 2354 2355 } 2355 2356 2356 function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part, $mode ) {2357 function iil_C_HandlePartBody(&$conn, $mailbox, $id, $part, $mode, $file=NULL) { 2357 2358 /* modes: 2358 1: return string 2359 1: return string (or write to $file pointer) 2359 2360 2: print 2360 3: base64 and print 2361 3: base64 and print (or write to $file pointer) 2361 2362 */ 2362 2363 … … 2364 2365 $result = false; 2365 2366 if (($part == 0) || empty($part)) { 2366 $part = 'TEXT';2367 } 2368 2367 $part = 'TEXT'; 2368 } 2369 2369 2370 if (iil_C_Select($conn, $mailbox)) { 2370 2371 $reply_key = '* ' . $id; … … 2400 2401 echo $result; 2401 2402 } else if ($mode == 3) { 2402 echo base64_decode($result); 2403 } 2403 if ($file) 2404 fwrite($file, base64_decode($result)); 2405 else 2406 echo base64_decode($result); 2407 } 2404 2408 } else if ($line[$len-1] == '}') { 2405 2409 //multi-line request, find sizes of content and receive that many bytes … … 2409 2413 $sizeStr = substr($line, $from, $len); 2410 2414 $bytes = (int)$sizeStr; 2411 $received = 0; 2412 2413 while ($received < $bytes) { 2414 $remaining = $bytes - $received; 2415 $line = iil_ReadLine($fp, 1024); 2415 2416 while ($bytes > 0) { 2417 $line = iil_ReadLine($fp, 1024); 2416 2418 $len = strlen($line); 2417 2419 2418 if ($len > $ remaining) {2419 $line = substr($line, 0, $ remaining);2420 if ($len > $bytes) { 2421 $line = substr($line, 0, $bytes); 2420 2422 } 2421 $received += strlen($line); 2423 $bytes -= strlen($line); 2424 2422 2425 if ($mode == 1) { 2423 $result .= rtrim($line, "\t\r\n\0\x0B") . "\n"; 2426 if ($file) 2427 fwrite($file, rtrim($line, "\t\r\n\0\x0B") . "\n"); 2428 else 2429 $result .= rtrim($line, "\t\r\n\0\x0B") . "\n"; 2424 2430 } else if ($mode == 2) { 2425 2431 echo rtrim($line, "\t\r\n\0\x0B") . "\n"; 2426 2432 } else if ($mode == 3) { 2427 echo base64_decode($line); 2428 } 2433 if ($file) 2434 fwrite($file, base64_decode($line)); 2435 else 2436 echo base64_decode($line); 2437 } 2429 2438 } 2430 2439 } 2431 // read in anything up until 'tillast line2440 // read in anything up until last line 2432 2441 do { 2433 2442 $line = iil_ReadLine($fp, 1024); 2434 2443 } while (!iil_StartsWith($line, $key)); 2435 2444 2445 if ($mode == 3 && $file) { 2446 return true; 2447 } 2448 2436 2449 if ($result) { 2437 2450 $result = rtrim($result, "\t\r\n\0\x0B"); 2438 return $result; // substr($result, 0, strlen($result)-1); 2451 if ($file) { 2452 fwrite($file, $result); 2453 return true; 2454 } 2455 return $result; // substr($result, 0, strlen($result)-1); 2439 2456 } 2440 2457 … … 2445 2462 2446 2463 if ($mode==1) { 2464 if ($file) { 2465 fwrite($file, $result); 2466 return true; 2467 } 2447 2468 return $result; 2448 2469 } 2449 return $received; 2450 } 2451 2452 function iil_C_FetchPartBody(&$conn, $mailbox, $id, $part) { 2453 return iil_C_HandlePartBody($conn, $mailbox, $id, $part, 1); 2470 2471 return false; 2472 } 2473 2474 function iil_C_FetchPartBody(&$conn, $mailbox, $id, $part, $file=NULL) { 2475 return iil_C_HandlePartBody($conn, $mailbox, $id, $part, 1, $file); 2454 2476 } 2455 2477 -
program/steps/mail/compose.inc
ra81be1b r81b573d 597 597 if ($fp = fopen($tmp_path, 'w')) 598 598 { 599 fwrite($fp, $message->get_part_content($pid));599 $message->get_part_content($pid, $fp); 600 600 fclose($fp); 601 601
Note: See TracChangeset
for help on using the changeset viewer.
