X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fimap_general.php;h=07fca8914032f733d06370061e1b1e1882b3f224;hp=26d9107c40d5a96a156279d21d90f5fe2d8d8d61;hb=9d157cec2821461fe4d348a47e2312db5e84c052;hpb=19acd99fabdc29d6e87eebb355f5f8c6b0fac4da
diff --git a/functions/imap_general.php b/functions/imap_general.php
index 26d9107c..07fca891 100755
--- a/functions/imap_general.php
+++ b/functions/imap_general.php
@@ -1,4 +1,4 @@
-
+$read
";
$counter = 0;
while ((substr($read, 0, strlen("$pre OK")) != "$pre OK") &&
(substr($read, 0, strlen("$pre BAD")) != "$pre BAD") &&
(substr($read, 0, strlen("$pre NO")) != "$pre NO")) {
$data[$counter] = $read;
$read = fgets ($imap_stream, 1024);
+// echo "$read
";
$counter++;
}
if (substr($read, 0, strlen("$pre OK")) == "$pre OK") {
@@ -63,28 +65,28 @@
** Logs the user into the imap server. If $hide is set, no error messages
** will be displayed. This function returns the imap connection handle.
******************************************************************************/
- function sqimap_login ($username, $password, $imap_server_address, $hide) {
+ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $hide) {
global $color;
- $imap_stream = fsockopen ($imap_server_address, 143, &$error_number, &$error_string);
+ $imap_stream = fsockopen ($imap_server_address, $imap_port, &$error_number, &$error_string);
$server_info = fgets ($imap_stream, 1024);
/** Do some error correction **/
if (!$imap_stream) {
if (!$hide) {
- echo "Error connecting to IMAP server: $imap_server_address.
\n";
- echo "$error_number : $error_string
\n";
+ echo "Error connecting to IMAP server: $imap_server_address.
\r\n";
+ echo "$error_number : $error_string
\r\n";
}
exit;
}
- fputs ($imap_stream, "a001 LOGIN \"$username\" \"$password\"\n");
+ fputs ($imap_stream, "a001 LOGIN \"$username\" \"$password\"\r\n");
$read = fgets ($imap_stream, 1024);
/** If the connection was not successful, lets see why **/
if (substr($read, 0, 7) != "a001 OK") {
if (!$hide) {
if (substr($read, 0, 8) == "a001 BAD") {
- echo "Bad request: $read
\n";
+ echo "Bad request: $read
\r\n";
exit;
} else if (substr($read, 0, 7) == "a001 NO") {
?>
@@ -97,7 +99,7 @@