Ignore:
Timestamp:
03/05/12 03:05:00 (12 years ago)
Author:
cristiano
Message:

Ticket #2497 - Nova estrategia para o salvamento automatico de rascunhos

File:
1 edited

Legend:

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

    r5605 r5620  
    27172717                //Compatibilização com Outlook, ao encaminhar a mensagem 
    27182718                $body = mb_ereg_replace('<!--\[', '<!-- [', $params['body']); 
     2719                $body = str_replace("%nbsp;","&nbsp;",$body); 
     2720                $body = preg_replace("/\n/"," ",$body); 
     2721                $body = preg_replace("/\r/","" ,$body); 
     2722                $body = html_entity_decode ( $body, ENT_QUOTES , 'ISO-8859-1' );         
    27192723            } 
    27202724 
     
    28932897                     else 
    28942898                         $mailService->addStringAttachment(base64_decode($att['source']), $att['name'], $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' ); 
    2895  
     2899                      
     2900                     $message_size_total += $att['size']; 
    28962901                     unset($att); 
    28972902                } 
     
    28992904                { 
    29002905                    $value = json_decode($value, true); 
    2901                     $sub =  $value['name'] ? $value['name'].'.eml' :'no title.eml'; 
    2902                     $mbox_stream = $this->open_mbox($value['folder']); 
    2903                     $rawmsg = $this->getRawHeader($value['uid']) . "\r\n\r\n" . $this->getRawBody($value['uid']); 
    2904                     $mailService->addStringAttachment($rawmsg, $sub, 'message/rfc822', '7bit', 'attachment' ); 
    2905                     $message_size_total += mb_strlen($rawmsg); //Adiciona o tamanho do anexo a variavel que controlao tamanho da msg. 
    2906                     unset($rawmsg); 
     2906 
     2907                    switch ($value['type']) { 
     2908                        case 'imapPart': 
     2909                                $att = $this->getForwardingAttachment($value['folder'],$value['uid'], $value['part']); 
     2910                                if(strstr($body,'<img src="./inc/get_archive.php?msgFolder='.$value['folder'].'&msgNumber='.$value['uid'].'&indexPart='.$value['part'].'" />') !== false)//Embeded IMG 
     2911                                {     
     2912                                    $body = str_ireplace('<img src="./inc/get_archive.php?msgFolder='.$value['folder'].'&msgNumber='.$value['uid'].'&indexPart='.$value['part'].'" />' , '<img src="'.$att['name'].'" />', $body); 
     2913                                    $mailService->addStringImage($att['source'], $att['type'], $att['name']); 
     2914                                } 
     2915                                else 
     2916                                    $mailService->addStringAttachment($att['source'], $att['name'], $att['type'], 'base64', isset($att['disposition']) ? $att['disposition'] :'attachment' ); 
     2917                                  
     2918                                $message_size_total += $att['size']; //Adiciona o tamanho do anexo a variavel que controlao tamanho da msg. 
     2919                                unset($att); 
     2920                            break; 
     2921                            case 'imapMSG': 
     2922                                $sub =  $value['name'] ? $value['name'].'.eml' :'no title.eml'; 
     2923                                $mbox_stream = $this->open_mbox($value['folder']); 
     2924                                $rawmsg = $this->getRawHeader($value['uid']) . "\r\n\r\n" . $this->getRawBody($value['uid']); 
     2925                                $mailService->addStringAttachment($rawmsg, $sub, 'message/rfc822', '7bit', 'attachment' ); 
     2926                                $message_size_total += mb_strlen($rawmsg); //Adiciona o tamanho do anexo a variavel que controlao tamanho da msg. 
     2927                                unset($rawmsg); 
     2928                            break; 
     2929 
     2930                        default: 
     2931                            break; 
     2932                    } 
    29072933                } 
    2908  
    29092934            } 
    2910  
     2935         
    29112936            $message_size_total += strlen($params['body']);   /* Tamanho do corpo da mensagem. */         
    29122937 
     
    30863111                return $bolean; 
    30873112        } 
    3088  
    3089         function get_forwarding_attachment($msg_folder, $msg_number, $msg_part, $encoding) 
    3090         { 
     3113         
     3114        function getForwardingAttachment($folder, $uid, $part, $rfc_822bodies = true , $info = true ) 
     3115        { 
    30913116            include_once dirname(__FILE__).'/class.attachment.inc.php'; 
    30923117            $attachment = new attachment(); 
    3093                         $attachment->decodeConf['rfc_822bodies'] = true; //Forçar a não decodificação de mensagens em anexo. 
    3094             $attachment->setStructureFromMail($msg_folder, $msg_number); 
    3095             return $attachment->getAttachment($msg_part); 
    3096         } 
    3097  
    3098         function get_forwarding_attachment2($msg_folder, $msg_number, $msg_part, $encoding) 
    3099         { 
    3100             include_once dirname(__FILE__).'/class.attachment.inc.php'; 
    3101             $attachment = new attachment(); 
    3102             $attachment->setStructureFromMail($msg_folder, $msg_number); 
    3103             $return = $attachment->getAttachmentInfo($msg_part); 
    3104             $return['binary'] = $attachment->getAttachment($msg_part); 
    3105             return $return; 
    3106         } 
    3107  
     3118            $attachment->decodeConf['rfc_822bodies'] = $rfc_822bodies; //Forçar a não decodificação de mensagens em anexo. 
     3119            $attachment->setStructureFromMail($folder, $uid); 
     3120             
     3121            if($info === true) 
     3122            { 
     3123                $return = $attachment->getAttachmentInfo($part); 
     3124                $return['source'] = $attachment->getAttachment($part); 
     3125                return $return; 
     3126            } 
     3127            return $attachment->getAttachment($part); 
     3128        } 
     3129             
    31083130        function del_last_caracter($string) 
    31093131        { 
Note: See TracChangeset for help on using the changeset viewer.