Changeset 504 for trunk/expressoMail1_2/inc/class.imap_functions.inc.php
- Timestamp:
- 10/07/08 14:50:11 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r485 r504 42 42 { 43 43 $folder = mb_convert_encoding($folder, "UTF7-IMAP","ISO_8859-1"); 44 $this->mbox = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$folder, $this->username, $this->password) or die(serialize(array('imap_error' => imap_last_error())));44 $this->mbox = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$folder, $this->username, $this->password) or die(serialize(array('imap_error' => $this->parse_error(imap_last_error())))); 45 45 return $this->mbox; 46 46 } 47 47 48 function parse_error($error){ 49 // This error is returned from Imap. 50 if(strstr($error,'Connection refused')) { 51 return str_replace("%1", $this->functions->getLang("Mail"), $this->functions->getLang("Connection failed with %1 Server. Try later.")); 52 } 53 // This error is returned from Postfix. 54 elseif(strstr($error,'message file too big')) { 55 return str_replace("%1", ini_get('upload_max_filesize'),$this->functions->getLang('The size of this message has exceeded the limit (%1B).')); 56 } 57 // This condition verifies if SESSION is expired. 58 elseif(!count($_SESSION)) 59 return "nosession"; 60 61 return $error; 62 } 63 48 64 function get_range_msgs2($params) 49 65 { … … 833 849 } 834 850 835 //$mbox_stream = $this->open_mbox($folder); 836 $mbox_stream = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$folder, $this->username, $this->password) or die(serialize(array('imap_error' => imap_last_error())));851 //$mbox_stream = $this->open_mbox($folder); 852 $mbox_stream = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}".$folder, $this->username, $this->password) or die(serialize(array('imap_error' => $this->parse_error(imap_last_error())))); 837 853 838 854 foreach ($msgs_number as $msg_number) … … 1259 1275 } 1260 1276 if( $total_uploaded_size > $upload_max_filesize) 1261 return 'false';1277 return $this->parse_error("message file too big"); 1262 1278 } 1263 1279 //////////////////////////////////////////////////////////////////////////////////////////////////// … … 1292 1308 $mail->ConfirmReadingTo = $_SESSION['phpgw_info']['expressomail']['user']['email']; 1293 1309 //////////////////////////////////////////////////////////////////////////////////////////////////// 1310 1294 1311 $sent = $mail->Send(); 1312 1295 1313 if(!$sent) 1296 1314 { 1297 return $ mail->ErrorInfo;1315 return $this->parse_error($mail->ErrorInfo); 1298 1316 } 1299 1317 else … … 1536 1554 $userID = $_SESSION['phpgw_info']['expressomail']['user']['userid']; 1537 1555 $server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; 1538 $mbox = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}INBOX", $accountID, $pass) or die(serialize(array('imap_error' => imap_last_error())));1556 $mbox = @imap_open("{".$this->imap_server.":".$this->imap_port.$this->imap_options."}INBOX", $accountID, $pass) or die(serialize(array('imap_error' => $this->parse_error(imap_last_error())))); 1539 1557 if(!$mbox) 1540 1558 return imap_last_error();
Note: See TracChangeset
for help on using the changeset viewer.