RFC 1732 (rfc1732) - Page 2 of 5


IMAP4 Compatibility with IMAP2 and IMAP2bis



Alternative Format: Original Text Document



RFC 1732                 IMAP4 - Compatibility             December 1994


IMAP4 client interoperability with old servers

   In general, a client should be able to discover whether an IMAP2
   server supports a facility by trial-and-error; if an attempt to use a
   facility generates a BAD response, the client can assume that the
   server does not support the facility.

   A quick way to check whether a server implementation supports the
   IMAP4 specification is to try the CAPABILITY command.  An OK response
   that includes the IMAP4 capability value indicates a server that
   supports IMAP4; a BAD response or one without the IMAP4 capability
   value indicates an older server.

   The following is a list of facilities that are only in IMAP4, and
   suggestions for how new clients might interoperate with old servers:

   CAPABILITY command
            A BAD response to this command indicates that the server
            implements IMAP2 (or IMAP2bis) and not IMAP4.

   AUTHENTICATE command.
            Use the LOGIN command.

   LSUB and LIST commands
            Try the RFC 1176 FIND command.

   * in a sequence
            Use the number of messages in the mailbox from the EXISTS
            unsolicited response.

   SEARCH extensions (character set, additional criteria)
            Reformulate the search request using only the searching
            options listed in search_old in the IMAP4 grammar.  This may
            entail doing multiple searches to achieve the desired
            results.

   BODYSTRUCTURE fetch data item
            Try to fetch the non-extensible BODY data item.

   body section number 0
            Fetch the entire message and extract the header.

   RFC 822.HEADER.LINES and RFC 822.HEADER.LINES.NOT fetch data items
            Use RFC 822.HEADER and remove the unwanted information.

   BODY.PEEK[section], RFC 822.PEEK, and RFC 822.TEXT.PEEK fetch data
            items Use the corresponding non-PEEK versions and manually
            clear the \Seen flag as necessary.



Crispin