Changeset 6561 for branches/2.3/expressoMail1_2
- Timestamp:
- 06/21/12 10:08:27 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php
r6516 r6561 4141 4141 $imap_port = $_SESSION['phpgw_info']['expressomail']['email_server']['imapPort']; 4142 4142 $imap_options = '/notls/novalidate-cert'; 4143 $mbox_stream = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$folder, $username, $password); 4144 if(imap_last_error() && imap_last_error() != "SECURITY PROBLEM: insecure server advertised AUTH=PLAIN") 4143 $mbox_stream = $this->open_mbox($folder); 4144 //$mbox_stream = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$folder, $username, $password); 4145 if($folder == "INBOX/decifradas" && imap_last_error() && imap_last_error() != "SECURITY PROBLEM: insecure server advertised AUTH=PLAIN") 4145 4146 { 4146 4147 imap_createmailbox($mbox_stream,imap_utf7_encode("{".$imap_server."}".$folder)); 4147 4148 } 4148 4149 // string date ( string $format [, int $timestamp = time() ] )4150 // bool imap_append ( resource $imap_stream , string $mailbox , string $message [, string $options = NULL [, string $internal_date = NULL ]] )4151 // 'd-M-Y H:i:s O'4152 4153 4149 $return = array(); 4154 4150 if($timestamp){ 4155 $tempDir = $_SESSION['phpgw_info']['server']['temp_dir']; 4156 $file = $tempDir."/imap_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]; 4157 $f = fopen($file,"w"); 4158 fputs($f,base64_encode($source)); 4159 fclose($f); 4160 $command = "python ".$_SERVER['DOCUMENT_ROOT']."/expressoMail1_2/imap.py ".escapeshellarg($imap_server)." ".escapeshellarg($imap_port)." ".escapeshellarg($username)." ".escapeshellarg($password)." ".escapeshellarg($timestamp)." ".escapeshellarg($folder)." ".escapeshellarg($file); 4161 $return['command']=exec(escapeshellcmd($command)); 4151 if(version_compare(PHP_VERSION, '5.3.2', '>=')){ 4152 $return['append'] = imap_append($mbox_stream, "{".$imap_server.":".$imap_port."}".mb_convert_encoding($folder, "UTF7-IMAP","ISO_8859-1"), $source,'',date('d-M-Y H:i:s O',$timestamp)); 4153 }else{ 4154 $tempDir = $_SESSION['phpgw_info']['server']['temp_dir']; 4155 $file = $tempDir."/imap_".$_SESSION[ 'phpgw_session' ][ 'session_id' ]; 4156 $f = fopen($file,"w"); 4157 fputs($f,base64_encode($source)); 4158 fclose($f); 4159 $command = "python ".$_SERVER['DOCUMENT_ROOT']."/expressoMail1_2/imap.py ".escapeshellarg($imap_server)." ".escapeshellarg($imap_port)." ".escapeshellarg($username)." ".escapeshellarg($password)." ".escapeshellarg($timestamp)." '".$folder."' ".escapeshellarg($file); 4160 $return['command']=exec(escapeshellcmd($command)); 4161 } 4162 4162 }else{ 4163 $return['append'] = imap_append($mbox_stream, "{".$imap_server.":".$imap_port."}". $folder, $source, "\\Seen");4163 $return['append'] = imap_append($mbox_stream, "{".$imap_server.":".$imap_port."}".mb_convert_encoding($folder, "UTF7-IMAP","ISO_8859-1"), $source, "\\Seen"); 4164 4164 } 4165 4165 … … 4174 4174 } 4175 4175 4176 $status = imap_status($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}". $folder, SA_UIDNEXT);4176 $status = imap_status($mbox_stream, "{".$this->imap_server.":".$this->imap_port."}".mb_convert_encoding($folder, "UTF7-IMAP","ISO_8859-1"), SA_UIDNEXT); 4177 4177 4178 4178 $return['msg_no'] = $status->uidnext - 1; … … 4284 4284 function unarchive_mail($params) 4285 4285 { 4286 $dest_folder = $params['folder'];4286 $dest_folder = urldecode($params['folder']); 4287 4287 $sources = explode("#@#@#@",$params['source']); 4288 4288 $timestamps = explode("#@#@#@",$params['timestamp']);
Note: See TracChangeset
for help on using the changeset viewer.