Ignore:
Timestamp:
05/29/12 14:05:15 (12 years ago)
Author:
rafaelraymundo
Message:

Ticket #2809 - Mensagem é apagada da origem caso o desarquivamento não tenha sucesso.

File:
1 edited

Legend:

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

    r6264 r6340  
    40564056            imap_createmailbox($mbox_stream,imap_utf7_encode("{".$imap_server."}".$folder)); 
    40574057        } 
     4058         
     4059        // string date ( string $format [, int $timestamp = time() ] ) 
     4060        // bool imap_append ( resource $imap_stream , string $mailbox , string $message [, string $options = NULL [, string $internal_date = NULL ]] ) 
     4061        // 'd-M-Y H:i:s O' 
     4062         
     4063        $return = array(); 
    40584064        if($timestamp){ 
    40594065            $tempDir = $_SESSION['phpgw_info']['server']['temp_dir']; 
     
    40674073            $return['append'] = imap_append($mbox_stream, "{".$imap_server.":".$imap_port."}".$folder, $source, "\\Seen"); 
    40684074        } 
     4075         
     4076        if (!empty($return['command'])) 
     4077        { 
     4078            list ($result, $msg) = explode(':',$return['command']); 
     4079            if (strtoupper($result) === 'NO') 
     4080            { 
     4081                $return['error'] = $msg; 
     4082                return $return; 
     4083            } 
     4084        } 
     4085         
    40694086        $status = imap_status($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}".$folder, SA_UIDNEXT); 
    40704087 
     
    41824199        $flags = explode("#@#@#@",$params['flags']); 
    41834200        $ids = explode("#@#@#@",$params['id']); 
    4184         $return = array();  
     4201        $return = array(); 
     4202        $archived = array(); 
     4203        $error = array(); 
    41854204 
    41864205        foreach($sources as $index=>$src) 
     
    41904209                $source = $this->treat_base64_from_post($src); 
    41914210                $insert = $this->insert_email($source,$dest_folder,$timestamps[$index],$flags[$index]); 
    4192                 if(!$insert['error']) 
    4193                     $return[] = $ids[$index]; 
     4211                if($insert['error']) 
     4212                { 
     4213                    $error[] = $ids[$index]; 
     4214                } 
     4215                else  
     4216                { 
     4217                    $archived[] = $ids[$index]; 
     4218                } 
    41944219            } 
    41954220        } 
     4221         
     4222        if (!empty($error)) 
     4223        { 
     4224            $return['error'] = $error; 
     4225        } 
     4226        if (!empty($archived)) 
     4227        { 
     4228            $return['archived'] = $archived; 
     4229        } 
    41964230         
    41974231        return $return; 
Note: See TracChangeset for help on using the changeset viewer.