Changeset 320 for trunk/expressoMail1_2/inc/class.imap_functions.inc.php
- Timestamp:
- 06/18/08 11:28:42 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r278 r320 275 275 $return['toaddress2'] .= " "; 276 276 $return['toaddress2'] .= "<"; 277 $return['toaddress2'] .= $tmp->mailbox . "@" . $tmp->host; 277 if ($tmp->host != 'unspecified-domain') 278 $return['toaddress2'] .= $tmp->mailbox . "@" . $tmp->host; 279 else 280 $return['toaddress2'] .= $tmp->mailbox; 278 281 $return['toaddress2'] .= ">"; 279 282 $return['toaddress2'] .= ", "; … … 281 284 else 282 285 { 283 $return['toaddress2'] .= $tmp->mailbox . "@" . $tmp->host; 286 if ($tmp->host != 'unspecified-domain') 287 $return['toaddress2'] .= $tmp->mailbox . "@" . $tmp->host; 288 else 289 $return['toaddress2'] .= $tmp->mailbox; 284 290 $return['toaddress2'] .= ", "; 285 291 } … … 351 357 $return['Size'] = $header->Size; 352 358 $return['reply_toaddress'] = $header->reply_toaddress; 359 353 360 return $return; 354 361 } … … 1471 1478 $ccaddress = $params['input_cc']; 1472 1479 $subject = $params['input_subject']; 1480 $msg_uid = $params['msg_id']; 1473 1481 $body = $params['body']; 1474 1482 $body = str_replace("%nbsp;"," ",$params['body']); … … 1507 1515 $mail->Body = $body; 1508 1516 1517 // Build CID for embedded Images!!! 1518 $pattern = '/src="([^"]*?show_embedded_attach.php\?msg_folder=(.+)?&msg_num=(.+)?&msg_part=(.+)?)"/isU'; 1519 $cid_imgs = ''; 1520 $name_cid_files = array(); 1521 preg_match_all($pattern,$mail->Body,$cid_imgs,PREG_PATTERN_ORDER); 1522 $cid_array = array(); 1523 foreach($cid_imgs[4] as $j => $val){ 1524 if ( !array_key_exists($cid_imgs[3][$j].$val, $cid_array) ) 1525 { 1526 $cid_array[$cid_imgs[3][$j].$val] = base_convert(microtime(), 10, 36); 1527 } 1528 $cid = $cid_array[$cid_imgs[3][$j].$val]; 1529 $mail->Body = str_replace($cid_imgs[1][$j], "cid:".$cid, $mail->Body); 1530 1531 if ($msg_uid != $cid_imgs[3][$j]) // The image isn't in the same mail? 1532 { 1533 $fileContent = $this->get_forwarding_attachment($cid_imgs[2][$j], $cid_imgs[3][$j], $cid_imgs[4][$j], 'base64'); 1534 $fileName = "image_".($j).".jpg"; 1535 $fileCode = "base64"; 1536 $fileType = "image/jpg"; 1537 } 1538 else 1539 { 1540 $attach_img = $forwarding_attachments[$cid_imgs[4][$j]-2]; 1541 $file_description = unserialize(rawurldecode($attach_img)); 1542 foreach($file_description as $i => $descriptor){ 1543 $file_description[$i] = eregi_replace('\'*\'','',$descriptor); 1544 } 1545 $fileContent = $this->get_forwarding_attachment($file_description[0], $msg_uid, $file_description[3], 'base64'); 1546 $fileName = $file_description[2]; 1547 $fileCode = $file_description[4]; 1548 $fileType = $this->get_file_type($file_description[2]); 1549 unset($forwarding_attachments[$cid_imgs[4][$j]-2]); 1550 if (!empty($file_description)) 1551 { 1552 $file_description[5] = strlen($fileContent); //Size of file 1553 $return_forward[] = $file_description; 1554 } 1555 } 1556 $tempDir = ini_get("session.save_path"); 1557 $file = "cid_image_".base_convert(microtime(), 10, 36).".dat"; 1558 $f = fopen($tempDir.'/'.$file,"w"); 1559 fputs($f,$fileContent); 1560 fclose($f); 1561 if ($fileContent) 1562 $mail->AddEmbeddedImage($tempDir.'/'.$file, $cid, $fileName, $fileCode, $fileType); 1563 //else 1564 // return "Error loading image attachment content"; 1565 1566 } 1509 1567 1510 1568 // Build Forwarding Attachments!!! … … 1757 1815 $search_box_type = $params['search_box_type'] != "ALL" && $params['search_box_type'] != "" ? $params['search_box_type'] : false; 1758 1816 $sort_array_msg = $this -> get_msgs($folder, $sort_box_type, $search_box_type, $sort_box_reverse); 1759 $i = 0; 1760 1761 while($sort_array_msg[$i] != $msg_number) 1762 { 1763 $i++; 1764 } 1765 1766 if ($i == (count($sort_array_msg)-1)) 1817 1818 $success = false; 1819 if (is_array($sort_array_msg)) 1820 { 1821 foreach ($sort_array_msg as $i => $value){ 1822 if ($value == $msg_number) 1823 { 1824 $success = true; 1825 break; 1826 } 1827 } 1828 } 1829 1830 if (! $success || $i >= sizeof($sort_array_msg)-1) 1767 1831 { 1768 1832 $params['status'] = 'false'; … … 1789 1853 $search_box_type = $params['search_box_type'] != "ALL" && $params['search_box_type'] != "" ? $params['search_box_type'] : false; 1790 1854 $sort_array_msg = $this -> get_msgs($folder, $sort_box_type, $search_box_type, $sort_box_reverse); 1791 $i = 0; 1792 1793 while($sort_array_msg[$i] != $msg_number) 1794 { 1795 $i++; 1796 } 1797 1798 if ($i == 0){ 1855 1856 $success = false; 1857 if (is_array($sort_array_msg)) 1858 { 1859 foreach ($sort_array_msg as $i => $value){ 1860 if ($value == $msg_number) 1861 { 1862 $success = true; 1863 break; 1864 } 1865 } 1866 } 1867 if (! $success || $i == 0) 1868 { 1799 1869 $params['status'] = 'false'; 1800 1870 $params['command_to_exec'] = "delete_border('". $reuse_border ."');";
Note: See TracChangeset
for help on using the changeset viewer.