RFC 2062

Internet Message Access Protocol - Obsolete Syntax

πŸ“… published December 1996, from ietf

Internet Message Access Protocol - Obsolete Syntax ✨

Okay bestie, let's get into RFC 2062 πŸ’– It's called Internet Message Access Protocol - Obsolete Syntax, written by M. Crispin at the University of Washington πŸŽ€ It's Informational, dated December 1996, and it came out of the Network Working Group 🌸 Nothing is listed as obsoleted or updated up top, so there's nothing to chase there ✨

Part 1 of 2 πŸ’…


Status of this Memo 🌸

This memo provides information for the Internet community πŸ’… It does not specify an Internet standard of any kind, and distribution of this memo is unlimited πŸ¦‹

Abstract πŸ’œ

So this doc describes obsolete syntax that IMAP4 implementations might bump into when they're dealing with older versions of the Internet Mail Access Protocol πŸ‘€ IMAP4 implementations MAY implement this syntax in order to maximize interoperability with older implementations 🫢

It also repeats info from earlier documents, most notably RFC 1176 and RFC 1730 πŸ“š

Obsolete Commands and Fetch Data Items 🧚

Okay so these commands are OBSOLETE (yes, all caps, it's serious 😀) It is NOT required to support any of these commands or fetch data items in new server implementations πŸ™ˆ They're only documented here for implementors who might want to support them so old client implementations still work πŸ’–

The section headings here line up with where they'd sit in the main document if they weren't obsoleted, so you can still find your way around πŸ—ΊοΈ

6.3.OBS.1. FIND ALL.MAILBOXES Command 🌸

Arguments:  mailbox name with possible wildcards

Data:       untagged responses: MAILBOX

Result:     OK - find completed
            NO - find failure: can't list that name
            BAD - command unknown or arguments invalid

The FIND ALL.MAILBOXES command returns a subset of names from the complete set of all names available to the user ✨ It returns zero or more untagged MAILBOX replies πŸ’… The mailbox argument is similar to the one for LIST with an empty reference, except that the characters % and ? match a single character πŸ¦‹

Example:

C: A002 FIND ALL.MAILBOXES *
S: * MAILBOX blurdybloop
S: * MAILBOX INBOX
S: A002 OK FIND ALL.MAILBOXES completed

6.3.OBS.2. FIND MAILBOXES Command πŸ’œ

Arguments:  mailbox name with possible wildcards

Data:       untagged responses: MAILBOX

Result:     OK - find completed
            NO - find failure: can't list that name
            BAD - command unknown or arguments invalid

The FIND MAILBOXES command returns a subset of names from the set of names the user has declared as being "active" or "subscribed" 🌈 It returns zero or more untagged MAILBOX replies πŸŽ€ The mailbox argument is similar to the one for LSUB with an empty reference, except that the characters % and ? match a single character πŸ’–

Example:

C: A002 FIND MAILBOXES *
S: * MAILBOX blurdybloop
S: * MAILBOX INBOX
S: A002 OK FIND MAILBOXES completed

6.3.OBS.3. SUBSCRIBE MAILBOX Command πŸ¦‹

Arguments:  mailbox name

Data:       no specific data for this command

Result:     OK - subscribe completed
            NO - subscribe failure: can't subscribe to that name
            BAD - command unknown or arguments invalid

The SUBSCRIBE MAILBOX command is identical in effect to the SUBSCRIBE command πŸ™Œ A server that implements this command must be able to distinguish between a SUBSCRIBE MAILBOX command and a SUBSCRIBE command with a mailbox name argument of "MAILBOX" 🀯 That's the whole plot twist, babe 😭

Example:

C: A002 SUBSCRIBE MAILBOX #news.comp.mail.mime
S: A002 OK SUBSCRIBE MAILBOX to #news.comp.mail.mime
completed
C: A003 SUBSCRIBE MAILBOX
S: A003 OK SUBSCRIBE to MAILBOX completed

6.3.OBS.4. UNSUBSCRIBE MAILBOX Command πŸ₯€

Arguments:  mailbox name

Data:       no specific data for this command

Result:     OK - unsubscribe completed
            NO - unsubscribe failure: can't unsubscribe that name
            BAD - command unknown or arguments invalid

The UNSUBSCRIBE MAILBOX command is identical in effect to the UNSUBSCRIBE command 🫠 A server that implements this command must be able to distinguish between an UNSUBSCRIBE MAILBOX command and an UNSUBSCRIBE command with a mailbox name argument of "MAILBOX" πŸ‘‘ Same energy as the subscribe one, periodt πŸ’…

Example:

C: A002 UNSUBSCRIBE MAILBOX #news.comp.mail.mime
S: A002 OK UNSUBSCRIBE MAILBOX from #news.comp.mail.mime
completed
C: A003 UNSUBSCRIBE MAILBOX
S: A003 OK UNSUBSCRIBE from MAILBOX completed

6.4.OBS.1 PARTIAL Command 🧁

Arguments:  message sequence number
            message data item name
            position of first octet
            number of octets

Data:       untagged responses: FETCH

Result:     OK - partial completed
            NO - partial error: can't fetch that data
            BAD - command unknown or arguments invalid

Okay so PARTIAL is basically FETCH, but with a glow-up: only the number of octets you ask for comes back, starting from the octet you pick πŸ’– Only a single message can be fetched at a time 🌸 The first octet of a message, and so the minimum starting octet, is octet 1 ✨

The FETCH items that are valid for PARTIAL are RFC822, RFC822.HEADER, RFC822.TEXT, BODY[<section>], plus any .PEEK forms of these πŸ¦‹

If a partial fetch tries to read past the end of the text, it gets truncated as appropriate 🫢 And if the starting octet is past the end of the text, you get an empty string back πŸ«₯

The data comes back with the FETCH response, and there's no indication of the range of the partial data in that response πŸ™ˆ You also can't stream multiple PARTIAL commands for the same data item without processing and synchronizing at each step, since streamed commands may run out of order πŸ˜΅β€πŸ’« Not a vibe πŸ’€

There's no requirement that partial fetches follow any sequence 🌈 For example, if a partial fetch of octets 1 through 10000 breaks in an awkward spot for BASE64 decoding, it is permitted to continue with a partial fetch of 9987 through 19987, etc. πŸŽ€ Flexible queen behavior πŸ‘‘

The handling of the \Seen flag is the same as in the associated FETCH command πŸ’…

Example:

C: A005 PARTIAL 4 RFC822 1 1024
S: * 1 FETCH (RFC822 {1024}
S: Return-Path: <gray@cac.washington.edu>
S: ...
S: .........  FLAGS (\Seen))
S: A005 OK PARTIAL completed

6.4.5.OBS.1 Obsolete FETCH Data Items πŸ“

The following FETCH data items are obsolete πŸ₯Ή

BODY[<...>0]   A body part number of 0 is the [RFC-822] header of
               the message.  BODY[0] is functionally equivalent to
               BODY[HEADER], differing in the syntax of the
               resulting untagged FETCH data (BODY[0] is
               returned).

RFC822.HEADER.LINES <header_list>
               Functionally equivalent to BODY.PEEK[HEADER.LINES
               <header_list>], differing in the syntax of the
               resulting untagged FETCH data (RFC822.HEADER is
               returned).

RFC822.HEADER.LINES.NOT <header_list>
               Functionally equivalent to
               BODY.PEEK[HEADER.LINES.NOT <header_list>],
               differing in the syntax of the resulting untagged
               FETCH data (RFC822.HEADER is returned).

RFC822.PEEK    Functionally equivalent to BODY.PEEK[], except for
               the syntax of the resulting untagged FETCH data
               (RFC822 is returned).

RFC822.TEXT.PEEK
               Functionally equivalent to BODY.PEEK[TEXT], except
               for the syntax of the resulting untagged FETCH data
               (RFC822.TEXT is returned).

Formal Syntax of Obsolete Commands and Responses ✨

okay so here's the grammar bit πŸ’… every obsolete rule that ends in _old gets tacked onto its buddy in the main formal syntax, like a little accessory πŸŽ€ for example, command_auth_old adds the FIND command to command_auth. iconic, right?

command_auth_old ::= find

command_select_old
                ::= partial

date_year_old   ::= 2digit
                    ;; (year - 1900)

date_time_old   ::= <"> date_day_fixed "-" date_month "-" date_year
                    SPACE time "-" zone_name <">

find            ::= "FIND" SPACE ["ALL."] "MAILBOXES" SPACE
                    list_mailbox

fetch_att_old   ::= "RFC822.HEADER.LINES" [".NOT"] SPACE header_list /
                    fetch_text_old

fetch_text_old  ::= "BODY" [".PEEK"] section_old /
                    "RFC822" [".HEADER" / ".TEXT" [".PEEK"]]

msg_data_old    ::= "COPY" / ("STORE" SPACE msg_att)

partial         ::= "PARTIAL" SPACE nz_number SPACE fetch_text_old SPACE
                    number SPACE number

section_old     ::= "[" (number ["." number]) "]"

subscribe_old   ::= "SUBSCRIBE" SPACE "MAILBOX" SPACE mailbox

unsubscribe_old ::= "UNSUBSCRIBE" SPACE "MAILBOX" SPACE mailbox

zone_name       ::= "UT" / "GMT" / "Z" /                ;; +0000
                    "AST" / "EDT" /                     ;; -0400
                    "EST" / "CDT" /                     ;; -0500
                    "CST" / "MDT" /                     ;; -0600
                    "MST" / "PDT" /                     ;; -0700
                    "PST" / "YDT" /                     ;; -0800
                    "YST" / "HDT" /                     ;; -0900
                    "HST" / "BDT" /                     ;; -1000
                    "BST" /                             ;; -1100
                    "A" / "B" / "C" / "D" / "E" / "F" / ;; +1 to +6
                    "G" / "H" / "I" / "K" / "L" / "M" / ;; +7 to +12
                    "N" / "O" / "P" / "Q" / "R" / "S" / ;; -1 to -6
                    "T" / "U" / "V" / "W" / "X" / "Y"   ;; -7 to -12

Security Considerations πŸ”

okay, real talk for a sec πŸ₯Ί this memo does not discuss security issues at all. not a single one. so if you're looking for threat models in here, you're gonna be disappointed bestie πŸ’€

Author's Address πŸ¦‹

Mark R. Crispin
Networks and Distributed Computing
University of Washington
4545 15th Aveneue NE
Seattle, WA  98105-4527

Phone: (206) 543-5762
EMail: MRC@CAC.Washington.EDU
πŸ“¦ where this page comes from