Changeset 3831


Ignore:
Timestamp:
02/28/11 16:33:32 (13 years ago)
Author:
eduardoalex
Message:

Ticket #1565 - Resolvendo problema quando não há nada no campo to.

Location:
branches/2.2/expressoMail1_2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php

    r3803 r3831  
    235235                $to = $header->to; 
    236236                $head_array['to'] = array(); 
    237                 $tmp = ( isset( $to[0]->personal ) ) ? imap_mime_header_decode($to[0]->personal) : NULL; 
    238                 $head_array['to']['name'] = ( isset( $tmp[0]->text ) ) ? $this->decode_string($this->decode_string($tmp[0]->text)) : NULL; 
    239                 $head_array['to']['email'] = ( isset( $to[0]->mailbox ) ) ? ( $this->decode_string($to[0]->mailbox) . "@" . ( ( isset( $to[0]->host ) ) ? $to[0]->host : '' ) ) : NULL; 
    240                 if(!$head_array['to']['name']) 
    241                         $head_array['to']['name'] = $head_array['to']['email']; 
     237                if($to[1] && $to[1]->host == ".SYNTAX-ERROR.") { //E-mails que não possuem o campo "para", vêm com o recipiente preenchido, porém com um recipiente a mais alegando erro de sintaxe. 
     238                        $head_array['to']['name'] = $head_array['to']['email'] = NULL; 
     239                } 
     240                else { 
     241                        $tmp = ( isset( $to[0]->personal ) ) ? imap_mime_header_decode($to[0]->personal) : NULL; 
     242                        $head_array['to']['name'] = ( isset( $tmp[0]->text ) ) ? $this->decode_string($this->decode_string($tmp[0]->text)) : NULL; 
     243                        $head_array['to']['email'] = ( isset( $to[0]->mailbox ) ) ? ( $this->decode_string($to[0]->mailbox) . "@" . ( ( isset( $to[0]->host ) ) ? $to[0]->host : '' ) ) : NULL; 
     244                        if(!$head_array['to']['name']) 
     245                                $head_array['to']['name'] = $head_array['to']['email']; 
     246                } 
    242247                $cc = $header->cc; 
     248                $cco = $header->bcc; 
    243249                if ( ($cc) && (!$head_array['to']['name']) ){ 
    244250                        $head_array['to']['name'] = ( isset( $cc[0]->personal ) ) ? $this->decode_string($cc[0]->personal) : NULL; 
    245251                        $head_array['to']['email'] = $this->decode_string($cc[0]->mailbox) . "@" . $cc[0]->host; 
     252                        if(!$head_array['to']['name']) 
     253                                $head_array['to']['name'] = $head_array['from']['email']; 
     254                } 
     255                else if ( ($cco) && (!$head_array['to']['name']) ){ 
     256                        $head_array['to']['name'] = ( isset( $cco[0]->personal ) ) ? $this->decode_string($cco[0]->personal) : NULL; 
     257                        $head_array['to']['email'] = $this->decode_string($cco[0]->mailbox) . "@" . $cco[0]->host; 
    246258                        if(!$head_array['to']['name']) 
    247259                                $head_array['to']['name'] = $head_array['from']['email']; 
  • branches/2.2/expressoMail1_2/js/draw_api.js

    r3819 r3831  
    10021002                                if(headers_msgs.to.email != null && headers_msgs.to.email.toLowerCase() != Element("user_email").value) 
    10031003                                        td_element24.innerHTML = "<img valign='center' src ='templates/"+template+"/images/sent.gif' title='"+get_lang('Sent')+"'>"; 
    1004  
    1005                                 if ((headers_msgs.to)&&(headers_msgs.to.name != null)) 
    1006                                         td_element3.innerHTML += headers_msgs.to.name; 
    1007                                 else if (headers_msgs.to){ 
    1008                                         td_element3.innerHTML += headers_msgs.to.email; 
     1004                                 
     1005                                if (headers_msgs.to) { 
     1006                                        if (headers_msgs.to.name != null) 
     1007                                                td_element3.innerHTML += headers_msgs.to.name; 
     1008                                        else if(headers_msgs.to.email != null) { 
     1009                                                td_element3.innerHTML += headers_msgs.to.email; 
     1010                                        } 
     1011                                        else { 
     1012                                                td_element3.innerHTML += get_lang("without destination"); 
     1013                                        } 
    10091014                                } 
    10101015                        } 
Note: See TracChangeset for help on using the changeset viewer.