Ignore:
Timestamp:
06/18/08 11:28:42 (16 years ago)
Author:
niltonneto
Message:

Versionamento 1.222
Ver changelog de alterações no Trac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r278 r320  
    275275                                        $return['toaddress2'] .= " "; 
    276276                                        $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; 
    278281                                        $return['toaddress2'] .= ">"; 
    279282                                        $return['toaddress2'] .= ", "; 
     
    281284                                else 
    282285                                { 
    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; 
    284290                                        $return['toaddress2'] .= ", "; 
    285291                                } 
     
    351357                $return['Size'] = $header->Size; 
    352358                $return['reply_toaddress'] = $header->reply_toaddress; 
     359                 
    353360                return $return; 
    354361        } 
     
    14711478                $ccaddress = $params['input_cc']; 
    14721479                $subject = $params['input_subject']; 
     1480                $msg_uid = $params['msg_id']; 
    14731481                $body = $params['body']; 
    14741482                $body = str_replace("%nbsp;"," ",$params['body']); 
     
    15071515                $mail->Body = $body; 
    15081516                 
     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                } 
    15091567         
    15101568        //      Build Forwarding Attachments!!!          
     
    17571815                $search_box_type = $params['search_box_type'] != "ALL" && $params['search_box_type'] != "" ? $params['search_box_type'] : false; 
    17581816                $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) 
    17671831                { 
    17681832                        $params['status'] = 'false'; 
     
    17891853                $search_box_type = $params['search_box_type'] != "ALL" && $params['search_box_type'] != "" ? $params['search_box_type'] : false; 
    17901854                $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                { 
    17991869                        $params['status'] = 'false'; 
    18001870                        $params['command_to_exec'] = "delete_border('". $reuse_border ."');"; 
Note: See TracChangeset for help on using the changeset viewer.