Changeset 504
- Timestamp:
- 10/07/08 14:50:11 (15 years ago)
- Location:
- trunk/expressoMail1_2
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/controller.php
r2 r504 20 20 // NO ACTION 21 21 else 22 return $_SESSION['response'] = ' false';22 return $_SESSION['response'] = 'Post-Content-Length'; 23 23 24 24 // Load dinamically class file. -
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(); -
trunk/expressoMail1_2/inc/class.phpmailer.php
r426 r504 345 345 */ 346 346 function Send() { 347 348 347 349 $header = ""; 348 350 $body = ""; … … 351 353 if(((count($this->to) + count($this->cc) + count($this->bcc)) < 1) && (!$this->SaveMessageAsDraft)) 352 354 { 353 $this->SetError($this->Lang("provide_address")); 355 $this->SetError($this->Lang("provide_address")); 354 356 return false; 355 357 } 356 358 357 359 // Set whether the message is multipart/alternative 358 360 if(!empty($this->AltBody)) … … 379 381 break; 380 382 default: 381 $this->SetError($this->Mailer . $this->Lang("mailer_not_supported"));383 $this->SetError($this->Mailer . $this->Lang("mailer_not_supported")); 382 384 $result = false; 383 385 break; … … 1168 1170 case "base64": 1169 1171 // chunk_split is found in PHP >= 3.0.6 1170 $encoded = chunk_split(base64_encode($str), 76, $this->LE);1172 $encoded = @chunk_split(base64_encode($str), 76, $this->LE); 1171 1173 break; 1172 1174 case "7bit": -
trunk/expressoMail1_2/js/main.js
r485 r504 77 77 78 78 79 function show_msg(msg_info){ 79 function show_msg(msg_info){ 80 80 if(!verify_session(msg_info)) 81 81 return; … … 872 872 } 873 873 else{ 874 if(data == ' false')874 if(data == 'Post-Content-Length') 875 875 write_msg(get_lang('The size of this message has exceeded the limit (%1B).',Element('upload_max_filesize').value)); 876 else if(data == null)877 write_msg( get_lang("your session could not be verified."));876 else if(data) 877 write_msg(data); 878 878 else 879 write_msg( data);879 write_msg(get_lang("Connection failed with %1 Server. Try later.", "Web")); 880 880 } 881 881 } … … 1366 1366 1367 1367 function verify_session(data){ 1368 1368 1369 if(data && data.imap_error) { 1369 write_msg(get_lang("your session could not be verified.")); 1370 // Hold session for edit message. 1371 if(!hold_session) 1372 location.href="../login.php?cd=10&phpgw_forward=%2FexpressoMail1_2%2Findex.php"; 1370 if(data.imap_error == "nosession") 1371 write_msg(get_lang("your session could not be verified.")); 1372 else 1373 write_msg(data.imap_error); 1374 // Hold sesion for edit message. 1375 //if(!hold_session) 1376 // location.href="../login.php?cd=10&phpgw_forward=%2FexpressoMail1_2%2Findex.php"; 1373 1377 return false; 1374 1378 }
Note: See TracChangeset
for help on using the changeset viewer.