From: kink Date: Wed, 6 Apr 2005 21:47:06 +0000 (+0000) Subject: Partial support for IMAP LOgin Referrals: tell the user what's going on X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1d20443c04896d47c55cdba84b337558e592a9d2;p=squirrelmail.git Partial support for IMAP LOgin Referrals: tell the user what's going on and log him out (RFC 2221) (Patch #1006242). git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9219 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/ChangeLog b/ChangeLog index aae8443a..9a50969b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -301,6 +301,9 @@ Version 1.5.1 -- CVS - src/delete_message.php script is disabled. It provided functions that could be implemented without playing with multiple redirects. - Remove lots of obsoleted code from left_main.php. + - Partial support of IMAP REFERRAL: do not fail on IMAP REFERRAL response + (RFC 2221) but log the user out with a hint. Patch by Ariel Arjona + (#1006242). Version 1.5.0 - 2 February 2004 ------------------------------- diff --git a/doc/rfc_documents.txt b/doc/rfc_documents.txt index afb8075b..fedc353f 100644 --- a/doc/rfc_documents.txt +++ b/doc/rfc_documents.txt @@ -14,6 +14,7 @@ RFC 1730 IMAP version 4 RFC 2060 IMAP version 4rev1 RFC 2183 Content-Disposition MIME header RFC 2195 IMAP/POP AUTHorize Extension for Simple Challenge/Response +RFC 2221 IMAP4 Login Referrals RFC 2298 Details return receipts RFC 2342 The IMAP4 NAMESPACE command RFC 2616 HTTP/1.1 diff --git a/functions/imap_general.php b/functions/imap_general.php index f866d1a1..319dcac8 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -818,6 +818,23 @@ function sqimap_login ($username, $password, $imap_server_address, $imap_port, $ exit; } } + + /* Special error case: + * Login referrals. The server returns: + * ? OK [REFERRAL ] + * Check RFC 2221 for details. Since we do not support login referrals yet + * we log the user out. + */ + if ( strpos($message, "REFERRAL") ) { + sqimap_logout($imap_stream); + set_up_language($squirrelmail_language, true); + include_once(SM_PATH . 'functions/display_messages.php' ); + sqsession_destroy(); + logout_error( _("Your mailbox is not located on this server.
". + "Try a different server or consult your Administrator") ); + exit; + } + return $imap_stream; }