$imap_server_address = sqimap_get_user_server($imap_server_address, $username);
$imap_stream = fsockopen ( $imap_server_address, $imap_port, $error_number, $error_string, 15);
- if ( !$imap_stream ) {
- return false;
- }
- $server_info = fgets ($imap_stream, 1024);
-
- /* Decrypt the password */
- $password = OneTimePadDecrypt($password, $onetimepad);
/* Do some error correction */
if (!$imap_stream) {
$string = sprintf (_("Error connecting to IMAP server: %s.") .
"<br>\r\n", $imap_server_address) .
"$error_number : $error_string<br>\r\n";
- error_box($string,$color);
+ logout_error($string,$color);
}
exit;
}
+ $server_info = fgets ($imap_stream, 1024);
+
+ /* Decrypt the password */
+ $password = OneTimePadDecrypt($password, $onetimepad);
+
$query = 'LOGIN "' . quoteIMAP($username) . '" "' . quoteIMAP($password) . '"';
$read = sqimap_run_command ($imap_stream, $query, false, $response, $message);
$tmp = fgets ($imap_stream, 1024);
}
-function sqimap_append_done ($imap_stream) {
+function sqimap_append_done ($imap_stream, $folder='') {
global $squirrelmail_language, $color;
fputs ($imap_stream, "\r\n");
$tmp = fgets ($imap_stream, 1024);
if (preg_match("/(.*)(BAD|NO)(.*)$/", $tmp, $regs)) {
set_up_language($squirrelmail_language);
require_once(SM_PATH . 'functions/display_messages.php');
- $string = "<b><font color=$color[2]>\n" .
+ $reason = $regs[3];
+ if ($regs[2] == 'NO') {
+ $string = "<b><font color=$color[2]>\n" .
+ _("ERROR : Could not append message to") ." $folder." .
+ "</b><br>\n" .
+ _("Server responded: ") .
+ $reason . "<br>\n";
+ if (preg_match("/(.*)(quota)(.*)$/i", $reason, $regs)) {
+ $string .= _("Solution: ") .
+ _("Remove unneccessary messages from your folder and start with your Trash folder.")
+ ."<br>\n";
+ }
+ $string .= "</font>\n";
+ error_box($string,$color);
+ } else {
+ $string = "<b><font color=$color[2]>\n" .
_("ERROR : Bad or malformed request.") .
"</b><br>\n" .
_("Server responded: ") .
$tmp . "</font><br>\n";
- error_box($string,$color);
- exit;
+ error_box($string,$color);
+ exit;
+ }
}
}