RFC 2221

IMAP4 Login Referrals

๐Ÿ“… published October 1997, from ietf

RFC 2221: IMAP4 Login Referrals ๐ŸŽ€

  • RFC number: 2221
  • Title: IMAP4 Login Referrals
  • Author: M. Gahrns, from Microsoft (Mike Gahrns, see Section 9 ๐Ÿซถ)
  • Category: Standards Track
  • Date: October 1997
  • Obsoletes / Updates: this title block doesn't list anything it obsoletes or updates ๐Ÿคทโ€โ™€๏ธ

Status of this Memo

okay so this part is the official "what is this doc" bit ๐Ÿ“œ. It says this is an Internet standards track protocol for the Internet community, and it's asking everyone to discuss it and send suggestions for making it better ๐Ÿ’ฌ. If you want to know where the protocol sits in the official standardization process, check the current edition of "Internet Official Protocol Standards" (STD 1) ๐Ÿง. And distribution is unlimited, so share it with everyone ๐ŸŒˆ.

Copyright (C) The Internet Society (1997). All Rights Reserved. ๐Ÿ’œ

1. Abstract โœจ

this is giving "big mailbox migration energy" ๐Ÿ“ฆ. When you have tons of users and a bunch of IMAP4 [RFC-2060] servers, you sometimes need to move people from one server to another ๐Ÿšš. Maybe hardware broke, maybe the org reshuffled, whatever ๐Ÿ˜ญ.

Login referrals are the fix ๐Ÿฆ‹. They let clients quietly hop over to a different IMAP4 server when someone's home server has changed, so the user never has to think about it ๐Ÿช„.

Then there's the "proxy method" ๐Ÿ™ˆ, where the local server goes and fetches everything from the remote server for the client, then passes it along. The referral way is kinda iconic because the client connects directly to the remote server. That's usually a better use of bandwidth, and the local server doesn't have to pretend to be the client when it logs in over there ๐Ÿ”ฅ.

2. Conventions used in this document ๐Ÿ“š

In examples, "C:" means lines from the client and "S:" means lines from the server ๐Ÿ’ป.

A home server is an IMAP4 server that holds the user's inbox ๐Ÿ .

A remote server is a server that holds remote mailboxes ๐ŸŒ.

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC-2119] ๐Ÿ’…. These are the official keyword rules, so don't mess with them ๐Ÿซข.

3. Introduction and Overview ๐ŸŒธ

IMAP4 servers that support this extension MUST list the keyword LOGIN-REFERRALS in their CAPABILITY response. The client doesn't have to do anything special to turn on the LOGIN-REFERRALS capability in a server. It just works โœจ.

Some rules for the referral chain ๐Ÿ”—: a LOGIN-REFERRALS capable IMAP4 server SHOULD NOT return a referral to a server that will return a referral. And a client MUST NOT follow more than 10 levels of referral without consulting the user ๐Ÿ™…โ€โ™€๏ธ. Nobody wants to get dragged through a 47-hop referral maze ๐Ÿ’€.

A LOGIN-REFERRALS response code MUST contain as an argument a valid IMAP server URL as defined in [IMAP-URL] ๐Ÿ”—. No vibes-based URLs allowed ๐Ÿ˜ค.

A home server referral is either a tagged NO or OK, or an untagged BYE response that has a LOGIN-REFERRALS response code in it ๐ŸŽฏ.

Example ๐ŸŽ€:

A001 NO [REFERRAL IMAP://user;AUTH=*@SERVER2/] Remote Server

NOTE: user;AUTH=* is specified as required by [IMAP-URL] to avoid a client falling back to anonymous login ๐Ÿ™ˆ. Keep that ;AUTH=* part, bestie, it's there for a reason ๐Ÿ”.

4. Home Server Referrals ๐Ÿก

A home server referral can come back in response to an AUTHENTICATE or LOGIN command, or it can show up in the connection startup banner ๐ŸŽ‰. If the server sends a home server referral in a tagged NO response, it means that server has zero mailboxes the user can access ๐Ÿšซ. If the referral comes in a tagged OK response, the user's personal mailboxes are somewhere else, but the server still has public mailboxes the user can read ๐Ÿ“ฌ. After a home server referral, the client can not make any assumptions about whether the move is permanent or temporary ๐Ÿคทโ€โ™€๏ธ. Don't assume, bestie ๐Ÿ™ƒ.

4.1. LOGIN and AUTHENTICATE Referrals ๐Ÿ”‘

An IMAP4 server MAY respond to a LOGIN or AUTHENTICATE command with a home server referral if it wants to send the user to another IMAP4 server ๐Ÿงš.

Examples ๐ŸŽ€:

C: A001 LOGIN MIKE PASSWORD
S: A001 NO [REFERRAL IMAP://MIKE@SERVER2/] Specified user
        is invalid on this server. Try SERVER2.
C: A001 LOGIN MATTHEW PASSWORD
S: A001 OK [REFERRAL IMAP://MATTHEW@SERVER2/] Specified
        user's personal mailboxes located on Server2, but
        public mailboxes are available.
C: A001 AUTHENTICATE GSSAPI
   <authentication exchange>
S: A001 NO [REFERRAL IMAP://user;AUTH=GSSAPI@SERVER2/]
        Specified user is invalid on this server. Try
        SERVER2.

4.2. BYE at connection startup referral ๐Ÿ‘‹

An IMAP4 server MAY respond with an untagged BYE and a REFERRAL response code that has an IMAP URL pointing to a home server. This is for when the server won't accept connections and wants to send the client to another IMAP4 server ๐Ÿšช.

Example ๐ŸŽ€:

S: * BYE [REFERRAL IMAP://user;AUTH=*@SERVER2/] Server not
         accepting connections.  Try SERVER2

5. Formal Syntax ๐Ÿงฉ

This uses the augmented Backus-Naur Form (BNF) described in [ABNF] ๐Ÿง . It also amends the "resp_text_code" element of the IMAP4 grammar from [RFC-2060] ๐Ÿ› ๏ธ.

resp_text_code =/ "REFERRAL" SPACE <imapurl>
   ; See [IMAP-URL] for definition of <imapurl>
   ; See [RFC-2060] for base definition of resp_text_code

6. Security Considerations ๐Ÿ”

This part is serious, bestie ๐Ÿ˜ญ. The login referral mechanism uses IMAP URLs, so it has the same security considerations as general internet URLs [RFC-1738], and in particular IMAP URLs [IMAP-URL] ๐Ÿซฃ.

A server MUST NOT give a login referral if authentication for that user fails. The point is to avoid leaking info about someone's account to an unauthorized person ๐Ÿ™ˆ. No free info for the nosy ๐Ÿšซ.

With the LOGIN-REFERRALS capability, it's potentially easier to build a rogue "password catching" server ๐Ÿ˜ˆ. That server collects login data and then refers the client to the real IMAP4 server. Referrals make that attack easier to set up, but the referral response also makes the intrusion easier to detect ๐Ÿ•ต๏ธโ€โ™€๏ธ. Plot twist, but still a warning ๐Ÿšจ.

7. References ๐Ÿ“–

[RFC-2060], Crispin, M., "Internet Message Access Protocol - Version 4rev1", RFC 2060, December 1996.

[IMAP-URL], Newman, C., "IMAP URL Scheme", RFC 2192, Innosoft, September 1997.

[RFC-1738], Berners-Lee, T., Masinter, L. and M. McCahill, "Uniform Resource Locators (URL)", RFC 1738, December 1994.

[RFC-2119], Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", RFC 2119, March 1997.

[ABNF], DRUMS working group, Dave Crocker Editor, "Augmented BNF for Syntax Specifications: ABNF", Work in Progress.

8. Acknowledgments ๐Ÿซถ

Lots of valuable suggestions came from private chats and the IMAP4 mailing list ๐Ÿ’Œ. Raymond Cheng, Mark Crispin, Mark Keasling, Chris Newman and Larry Osterman made major contributions to this document, so give them all the flowers ๐Ÿ’๐ŸŒท.

9. Author's Address ๐Ÿ“ฎ

Mike Gahrns Microsoft One Microsoft Way Redmond, WA, 98072

Phone: (206) 936-9833 EMail: mikega@microsoft.com

Copyright (C) The Internet Society (1997). All Rights Reserved.

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implmentation may be prepared, copied, published andand distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐Ÿ’–

๐Ÿ“ฆ where this page comes from