| < draft-leiba-imap-implement-guide-02.txt | draft-leiba-imap-implement-guide-03.txt > | |||
|---|---|---|---|---|
| Network Working Group B. Leiba | Network Working Group B. Leiba | |||
| Internet Draft IBM T.J. Watson Research Center | Internet Draft IBM T.J. Watson Research Center | |||
| Document: draft-leiba-imap-implement-guide-02.txt September 1997 | Document: draft-leiba-imap-implement-guide-03.txt October 1997 | |||
| Expires February 1998 | Expires March 1998 | |||
| IMAP4 Implementation Recommendations | IMAP4 Implementation Recommendations | |||
| Status of this Document | Status of this Document | |||
| This document provides information for the Internet community. This | This document provides information for the Internet community. This | |||
| document does not specify an Internet standard of any kind. | document does not specify an Internet standard of any kind. | |||
| Distribution of this document is unlimited. | Distribution of this document is unlimited. | |||
| This document is an Internet Draft. Internet Drafts are working | This document is an Internet Draft. Internet Drafts are working | |||
| skipping to change at page 1, line 34 ¶ | skipping to change at page 1, line 34 ¶ | |||
| Drafts as reference material or to cite them other than as a "working | Drafts as reference material or to cite them other than as a "working | |||
| draft" or "work in progress". | draft" or "work in progress". | |||
| To learn the current status of any Internet-Draft, please check the | To learn the current status of any Internet-Draft, please check the | |||
| 1id-abstracts.txt listing contained in the Internet-Drafts Shadow | 1id-abstracts.txt listing contained in the Internet-Drafts Shadow | |||
| Directories on ds.internic.net, nic.nordu.net, ftp.isi.edu, or | Directories on ds.internic.net, nic.nordu.net, ftp.isi.edu, or | |||
| munnari.oz.au. | munnari.oz.au. | |||
| A revised version of this draft document will be submitted to the RFC | A revised version of this draft document will be submitted to the RFC | |||
| editor. Discussion and suggestions for improvement are requested. | editor. Discussion and suggestions for improvement are requested. | |||
| This document will expire by the end of February 1998. | This document will expire by the end of March 1998. | |||
| 1. Abstract | 1. Abstract | |||
| The IMAP4 specification [RFC-2060] describes a rich protocol for use | The IMAP4 specification [RFC-2060] describes a rich protocol for use | |||
| in building clients and servers for storage, retrieval, and | in building clients and servers for storage, retrieval, and | |||
| manipulation of electronic mail. Because the protocol is so rich and | manipulation of electronic mail. Because the protocol is so rich and | |||
| has so many implementation choices, there are often trade-offs that | has so many implementation choices, there are often trade-offs that | |||
| must be made and issues that must be considered when designing such | must be made and issues that must be considered when designing such | |||
| clients and servers. This document attempts to outline these issues | clients and servers. This document attempts to outline these issues | |||
| and to make recommendations in order to make the end products as | and to make recommendations in order to make the end products as | |||
| skipping to change at page 4, line 28 ¶ | skipping to change at page 4, line 28 ¶ | |||
| There are three situations when a client can make a request that will | There are three situations when a client can make a request that will | |||
| result in a very large response - too large for the client reasonably | result in a very large response - too large for the client reasonably | |||
| to deal with: there are a great many mailboxes available, there are a | to deal with: there are a great many mailboxes available, there are a | |||
| great many messages in the selected mailbox, or there is a very large | great many messages in the selected mailbox, or there is a very large | |||
| message part. The danger here is that the end user will be stuck | message part. The danger here is that the end user will be stuck | |||
| waiting while the server sends (and the client processes) an enormous | waiting while the server sends (and the client processes) an enormous | |||
| response. In all of these cases there are things a client can do to | response. In all of these cases there are things a client can do to | |||
| reduce that danger. | reduce that danger. | |||
| There is also the case where a client can flood a server, by sending | There is also the case where a client can flood a server, by sending | |||
| an arbitratily long command. Well discuss that issue, too, in this | an arbitratily long command. We'll discuss that issue, too, in this | |||
| section. | section. | |||
| 3.2.1.1. Listing Mailboxes | 3.2.1.1. Listing Mailboxes | |||
| Some servers present Usenet newsgroups to IMAP users. Newsgroups, | Some servers present Usenet newsgroups to IMAP users. Newsgroups, | |||
| and other such hierarchical mailbox structures, can be very numerous | and other such hierarchical mailbox structures, can be very numerous | |||
| but may have only a few entries at the top level of hierarchy. Also, | but may have only a few entries at the top level of hierarchy. Also, | |||
| some servers are built against mail stores that can, unbeknownst to | some servers are built against mail stores that can, unbeknownst to | |||
| the server, have circular hierarchies - that is, its possible for | the server, have circular hierarchies - that is, it's possible for | |||
| "a/b/c/d" to resolve to the same file structure as "a", which would | "a/b/c/d" to resolve to the same file structure as "a", which would | |||
| then mean that "a/b/c/d/b" is the same as "a/b", and the hierarchy | then mean that "a/b/c/d/b" is the same as "a/b", and the hierarchy | |||
| will never end. The LIST response in this case will be unlimited. | will never end. The LIST response in this case will be unlimited. | |||
| Clients that will have trouble with this are those that use | Clients that will have trouble with this are those that use | |||
| C: 001 LIST "" * | C: 001 LIST "" * | |||
| to determine the mailbox list. Because of this, clients SHOULD NOT | to determine the mailbox list. Because of this, clients SHOULD NOT | |||
| use an unqualified "*" that way in the LIST command. A safer | use an unqualified "*" that way in the LIST command. A safer | |||
| approach is to list each level of hierarchy individually, allowing | approach is to list each level of hierarchy individually, allowing | |||
| the user to traverse the tree one limb at a time, thus: | the user to traverse the tree one limb at a time, thus: | |||
| skipping to change at page 5, line 52 ¶ | skipping to change at page 5, line 52 ¶ | |||
| ...etc... | ...etc... | |||
| Using this method, another command, such as "FETCH 6 BODY[1]" can be | Using this method, another command, such as "FETCH 6 BODY[1]" can be | |||
| inserted as necessary, and the client will not have its access to the | inserted as necessary, and the client will not have its access to the | |||
| server blocked by a storm of FETCH replies. (Such a method could be | server blocked by a storm of FETCH replies. (Such a method could be | |||
| reversed to fetch the LAST 50 messages first, then the 50 prior to | reversed to fetch the LAST 50 messages first, then the 50 prior to | |||
| that, and so on.) | that, and so on.) | |||
| As a smart extension of this, a well designed client, prepared for | As a smart extension of this, a well designed client, prepared for | |||
| very large mailboxes, will not automatically fetch data for all | very large mailboxes, will not automatically fetch data for all | |||
| messages AT ALL. Rather, the client will populate the users view | messages AT ALL. Rather, the client will populate the user's view | |||
| only as the user sees it, possibly pre-fetching selected information, | only as the user sees it, possibly pre-fetching selected information, | |||
| and only fetching other information as the user scrolls to it. For | and only fetching other information as the user scrolls to it. For | |||
| Internet DRAFT Implementation Recommendations September 1997 | Internet DRAFT Implementation Recommendations September 1997 | |||
| example, to select only those messages beginning with the first | example, to select only those messages beginning with the first | |||
| unseen one: | unseen one: | |||
| C: 003 SELECT INBOX | C: 003 SELECT INBOX | |||
| S: * 10000 EXISTS | S: * 10000 EXISTS | |||
| skipping to change at page 7, line 39 ¶ | skipping to change at page 7, line 39 ¶ | |||
| text message with a large ZIP file attached may prefer to read the | text message with a large ZIP file attached may prefer to read the | |||
| text only and save the ZIP file for later. Therefore, a client | text only and save the ZIP file for later. Therefore, a client | |||
| SHOULD NOT normally retrieve entire messages and SHOULD retrieve | SHOULD NOT normally retrieve entire messages and SHOULD retrieve | |||
| message body parts selectively. | message body parts selectively. | |||
| 3.2.1.5. Long Command Lines | 3.2.1.5. Long Command Lines | |||
| A client can wind up building a very long command line in an effort | A client can wind up building a very long command line in an effort | |||
| to try to be efficient about requesting information from a server. | to try to be efficient about requesting information from a server. | |||
| This can typically happen when a client builds a message set from | This can typically happen when a client builds a message set from | |||
| selected messages and doesnt recognise that contiguous blocks of | selected messages and doesn't recognise that contiguous blocks of | |||
| messages may be group in a range. Suppose a user selects all 10,000 | messages may be group in a range. Suppose a user selects all 10,000 | |||
| messages in a large mailbox and then unselects message 287. The | messages in a large mailbox and then unselects message 287. The | |||
| client could build that message set as "1:286,288:10000", but a | client could build that message set as "1:286,288:10000", but a | |||
| client that doesnt handle that might try to enumerate each message | client that doesn't handle that might try to enumerate each message | |||
| individually and build "1,2,3,4, [and so on] ,9999,10000". Adding | individually and build "1,2,3,4, [and so on] ,9999,10000". Adding | |||
| that to the fetch command results in a command line thats almost | that to the fetch command results in a command line that's almost | |||
| 49,000 octets long, and, clearly, one can construct a command line | 49,000 octets long, and, clearly, one can construct a command line | |||
| thats even longer. | that's even longer. | |||
| A client SHOULD limit the length of the command lines it generates to | A client SHOULD limit the length of the command lines it generates to | |||
| approximately 1000 octets (including all quoted strings but not | approximately 1000 octets (including all quoted strings but not | |||
| including literals). If the client is unable to group things into | including literals). If the client is unable to group things into | |||
| ranges so that the command line is within that length, it SHOULD | ranges so that the command line is within that length, it SHOULD | |||
| split the request into multiple commands. The client SHOULD use | split the request into multiple commands. The client SHOULD use | |||
| literals instead of long quoted strings, in order to keep the command | literals instead of long quoted strings, in order to keep the command | |||
| Internet DRAFT Implementation Recommendations September 1997 | Internet DRAFT Implementation Recommendations September 1997 | |||
| length down. | length down. | |||
| For its part, a server SHOULD allow for a command line of at least | For its part, a server SHOULD allow for a command line of at least | |||
| 8000 octets. This provides plenty of leeway for accepting reasonable | 8000 octets. This provides plenty of leeway for accepting reasonable | |||
| length commands from clients. The server SHOULD send a BAD response | length commands from clients. The server SHOULD send a BAD response | |||
| to a command that does not end within the servers maximum accepted | to a command that does not end within the server's maximum accepted | |||
| command length. | command length. | |||
| 3.2.2. Subscriptions | 3.2.2. Subscriptions | |||
| The client isn't the only entity that can get flooded: the end user, | The client isn't the only entity that can get flooded: the end user, | |||
| too, may need some flood control. The IMAP4 protocol provides such | too, may need some flood control. The IMAP4 protocol provides such | |||
| control in the form of subscriptions. Most servers support the | control in the form of subscriptions. Most servers support the | |||
| SUBSCRIBE, UNSUBSCRIBE, and LSUB commands, and many users choose to | SUBSCRIBE, UNSUBSCRIBE, and LSUB commands, and many users choose to | |||
| narrow down a large list of available mailboxes by subscribing to the | narrow down a large list of available mailboxes by subscribing to the | |||
| ones that they usually want to see. Clients, with this in mind, | ones that they usually want to see. Clients, with this in mind, | |||
| skipping to change at page 9, line 18 ¶ | skipping to change at page 9, line 18 ¶ | |||
| back-ends with indexed search capabilities, may return search results | back-ends with indexed search capabilities, may return search results | |||
| that do not match the IMAP spec's "case-insensitive substring" | that do not match the IMAP spec's "case-insensitive substring" | |||
| requirements. While these servers are in violation of the protocol, | requirements. While these servers are in violation of the protocol, | |||
| there is little harm in the violation as long as the search results | there is little harm in the violation as long as the search results | |||
| are used only to response to a user's request. Still, developers of | are used only to response to a user's request. Still, developers of | |||
| such servers should be aware that they ARE violating the protocol, | such servers should be aware that they ARE violating the protocol, | |||
| should think carefully about that behaviour, and MUST be certain that | should think carefully about that behaviour, and MUST be certain that | |||
| their servers respond accurately to the flag searches for the reasons | their servers respond accurately to the flag searches for the reasons | |||
| outlined above. | outlined above. | |||
| In addition, servers SHOULD support CHARSET UTF-8 in searches. | ||||
| 3.3 Avoiding Invalid Requests | 3.3 Avoiding Invalid Requests | |||
| IMAP4 provides ways for a server to tell a client in advance what is | IMAP4 provides ways for a server to tell a client in advance what is | |||
| and isnt permitted in some circumstances. Clients SHOULD use these | and isn't permitted in some circumstances. Clients SHOULD use these | |||
| features to avoid sending requests that a well designed client would | features to avoid sending requests that a well designed client would | |||
| know to be invalid. This section explains this in more detail. | know to be invalid. This section explains this in more detail. | |||
| 3.3.1. The CAPABILITY Command | 3.3.1. The CAPABILITY Command | |||
| All IMAP4 clients SHOULD use the CAPABILITY command to determine what | All IMAP4 clients SHOULD use the CAPABILITY command to determine what | |||
| version of IMAP and what optional features a server supports. The | version of IMAP and what optional features a server supports. The | |||
| client SHOULD NOT send IMAP4rev1 commands and arguments to a server | client SHOULD NOT send IMAP4rev1 commands and arguments to a server | |||
| that does not advertize IMAP4rev1 in its CAPABILITY response. | that does not advertize IMAP4rev1 in its CAPABILITY response. | |||
| Similarly, the client SHOULD NOT send IMAP4 commands that no longer | Similarly, the client SHOULD NOT send IMAP4 commands that no longer | |||
| exist in IMAP4rev1 to a server that does not advertize IMAP4 in its | exist in IMAP4rev1 to a server that does not advertize IMAP4 in its | |||
| CAPABILITY response. An IMAP4rev1 server is NOT required to support | CAPABILITY response. An IMAP4rev1 server is NOT required to support | |||
| obsolete IMAP4 or IMAP2bis commands (though some do; do not let this | obsolete IMAP4 or IMAP2bis commands (though some do; do not let this | |||
| fact lull you into thinking that its valid to send such commands to | fact lull you into thinking that it's valid to send such commands to | |||
| an IMAP4rev1 server). | an IMAP4rev1 server). | |||
| A client SHOULD NOT send commands to probe for the existance of | A client SHOULD NOT send commands to probe for the existance of | |||
| certain extensions. All standard and standards-track extensions | certain extensions. All standard and standards-track extensions | |||
| include CAPABILITY tokens indicating their presense. All private and | include CAPABILITY tokens indicating their presense. All private and | |||
| experimental extensions SHOULD do the same, and clients that take | experimental extensions SHOULD do the same, and clients that take | |||
| advantage of them SHOULD use the CAPABILITY response to determine | advantage of them SHOULD use the CAPABILITY response to determine | |||
| whether they may be used or not. | whether they may be used or not. | |||
| 3.3.2. Dont Do What the Server Says You Cant | 3.3.2. Don't Do What the Server Says You Can't | |||
| In many cases, the server, in response to a command, will tell the | In many cases, the server, in response to a command, will tell the | |||
| client something about what can and cant be done with a particular | client something about what can and can't be done with a particular | |||
| mailbox. The client SHOULD pay attention to this information and | mailbox. The client SHOULD pay attention to this information and | |||
| SHOULD NOT try to do things that its been told it cant do. | SHOULD NOT try to do things that it's been told it can't do. | |||
| Examples: | ||||
| * Do not try to SELECT a mailbox that has the \Noselect flag set. | ||||
| Internet DRAFT Implementation Recommendations September 1997 | Internet DRAFT Implementation Recommendations September 1997 | |||
| Examples: | ||||
| * Do not try to SELECT a mailbox that has the \Noselect flag set. | ||||
| * Do not try to CREATE a sub-mailbox in a mailbox that has the | * Do not try to CREATE a sub-mailbox in a mailbox that has the | |||
| \Noinferiors flag set. | \Noinferiors flag set. | |||
| * Do not respond to a failing COPY or APPEND command by trying to | * Do not respond to a failing COPY or APPEND command by trying to | |||
| CREATE the target mailbox if the server does not respond with a | CREATE the target mailbox if the server does not respond with a | |||
| [TRYCREATE] response code. | [TRYCREATE] response code. | |||
| * Do not try to expunge a mailbox that has been selected with the | * Do not try to expunge a mailbox that has been selected with the | |||
| [READ-ONLY] response code. | [READ-ONLY] response code. | |||
| 3.4. Miscellaneous Protocol Considerations | 3.4. Miscellaneous Protocol Considerations | |||
| skipping to change at page 10, line 40 ¶ | skipping to change at page 10, line 42 ¶ | |||
| that will crash if there are protocol errors. There are clients that | that will crash if there are protocol errors. There are clients that | |||
| will report every parser burp to the user. And in any case, | will report every parser burp to the user. And in any case, | |||
| information that cannot be parsed is information that is lost. Be | information that cannot be parsed is information that is lost. Be | |||
| careful in your protocol generation. And see "A Word About Testing", | careful in your protocol generation. And see "A Word About Testing", | |||
| below. | below. | |||
| In particular, note that the string in the INTERNALDATE response is | In particular, note that the string in the INTERNALDATE response is | |||
| NOT an RFC-822 date string - that is, it is not in the same format as | NOT an RFC-822 date string - that is, it is not in the same format as | |||
| the first string in the ENVELOPE response. Since most clients will, | the first string in the ENVELOPE response. Since most clients will, | |||
| in fact, accept an RFC-822 date string in the INTERNALDATE response, | in fact, accept an RFC-822 date string in the INTERNALDATE response, | |||
| its easy to miss this in your interoperability testing. But it will | it's easy to miss this in your interoperability testing. But it will | |||
| cause a problem with some client, so be sure to generate the correct | cause a problem with some client, so be sure to generate the correct | |||
| string for this field. | string for this field. | |||
| 3.4.2. Special Characters | 3.4.2. Special Characters | |||
| Certain characters, currently the double-quote and the backslash, may | Certain characters, currently the double-quote and the backslash, may | |||
| not be sent as-is inside a quoted string. These characters MUST be | not be sent as-is inside a quoted string. These characters MUST be | |||
| preceded by the escape character if they are in a quoted string, or | preceded by the escape character if they are in a quoted string, or | |||
| else the string must be sent as a literal. Both clients and servers | else the string must be sent as a literal. Both clients and servers | |||
| MUST handle this, both on output (they must send these characters | MUST handle this, both on output (they must send these characters | |||
| properly) and on input (they must be able to receive escaped | ||||
| Internet DRAFT Implementation Recommendations September 1997 | Internet DRAFT Implementation Recommendations September 1997 | |||
| properly) and on input (they must be able to receive escaped | ||||
| characters in quoted strings). Example: | characters in quoted strings). Example: | |||
| C: 001 LIST "" % | C: 001 LIST "" % | |||
| S: * LIST () "" INBOX | S: * LIST () "" INBOX | |||
| S: * LIST () "\\" TEST | S: * LIST () "\\" TEST | |||
| S: * LIST () "\\" {12} | S: * LIST () "\\" {12} | |||
| S: "My" mailbox | S: "My" mailbox | |||
| S: 001 OK done | S: 001 OK done | |||
| C: 002 LIST "" "\"My\" mailbox\\%" | C: 002 LIST "" "\"My\" mailbox\\%" | |||
| S: * LIST () "\\" {17} | S: * LIST () "\\" {17} | |||
| skipping to change at page 11, line 54 ¶ | skipping to change at page 12, line 4 ¶ | |||
| they have saved about UIDs in that mailbox. There have been many | they have saved about UIDs in that mailbox. There have been many | |||
| problems in this area when clients have failed to do this; in the | problems in this area when clients have failed to do this; in the | |||
| worst case it will result in loss of mail when a client deletes the | worst case it will result in loss of mail when a client deletes the | |||
| wrong piece of mail by using a stale UID. | wrong piece of mail by using a stale UID. | |||
| It seems to be a common myth that "the UIDVALIDITY and the UID, taken | It seems to be a common myth that "the UIDVALIDITY and the UID, taken | |||
| together, form a 64-bit identifier that uniquely identifies a message | together, form a 64-bit identifier that uniquely identifies a message | |||
| on a server". This is absolutely NOT TRUE. There is no assurance | on a server". This is absolutely NOT TRUE. There is no assurance | |||
| that the UIDVALIDITY values of two mailboxes be different, so the | that the UIDVALIDITY values of two mailboxes be different, so the | |||
| UIDVALIDITY in no way identifies a mailbox. The ONLY purpose of | UIDVALIDITY in no way identifies a mailbox. The ONLY purpose of | |||
| UIDVALIDITY is, as its name indicates, to give the client a way to | ||||
| Internet DRAFT Implementation Recommendations September 1997 | Internet DRAFT Implementation Recommendations September 1997 | |||
| UIDVALIDITY is, as its name indicates, to give the client a way to | ||||
| check the validity of the UIDs it has cached. While it is a valid | check the validity of the UIDs it has cached. While it is a valid | |||
| implementation choice to put these values together to make a 64-bit | implementation choice to put these values together to make a 64-bit | |||
| identifier for the message, the important concept here is that UIDs | identifier for the message, the important concept here is that UIDs | |||
| are not unique between mailboxes; they are only unique WITHIN a given | are not unique between mailboxes; they are only unique WITHIN a given | |||
| mailbox. | mailbox. | |||
| Some server implementations have toyed with making UIDs unique across | Some server implementations have toyed with making UIDs unique across | |||
| the entire server. This is inadvisable, in that it limits the life | the entire server. This is inadvisable, in that it limits the life | |||
| of UIDs unnecessarily. The UID is a 32-bit number and will run out | of UIDs unnecessarily. The UID is a 32-bit number and will run out | |||
| in reasonably finite time if it's global across the server. If you | in reasonably finite time if it's global across the server. If you | |||
| skipping to change at page 12, line 55 ¶ | skipping to change at page 13, line 4 ¶ | |||
| C: 032 UID STORE 382 +Flags.silent \Deleted | C: 032 UID STORE 382 +Flags.silent \Deleted | |||
| S: * OK [UIDVALIDITY 12345] New UIDVALIDITY value! | S: * OK [UIDVALIDITY 12345] New UIDVALIDITY value! | |||
| S: 032 NO UID command rejeced because UIDVALIDITY changed! | S: 032 NO UID command rejeced because UIDVALIDITY changed! | |||
| C: ...invalidates local information and re-fetches... | C: ...invalidates local information and re-fetches... | |||
| C: 033 FETCH 1:* UID | C: 033 FETCH 1:* UID | |||
| ...etc... | ...etc... | |||
| At the time of the writing of this document, the only server known to | At the time of the writing of this document, the only server known to | |||
| do this does so only under the following condition: the client | do this does so only under the following condition: the client | |||
| selects INBOX, but there is not yet a physical INBOX file created. | selects INBOX, but there is not yet a physical INBOX file created. | |||
| Nonetheless, the SELECT succeeds, exporting an empty INBOX with a | ||||
| Internet DRAFT Implementation Recommendations September 1997 | Internet DRAFT Implementation Recommendations September 1997 | |||
| Nonetheless, the SELECT succeeds, exporting an empty INBOX with a | ||||
| temporary UIDVALIDITY of 1. While the INBOX remains selected, mail | temporary UIDVALIDITY of 1. While the INBOX remains selected, mail | |||
| is delivered to the user, which creates the real INBOX file and | is delivered to the user, which creates the real INBOX file and | |||
| assigns a permanent UIDVALIDITY (that is likely not to be 1). The | assigns a permanent UIDVALIDITY (that is likely not to be 1). The | |||
| server reports the change of UIDVALIDITY, but as there were no | server reports the change of UIDVALIDITY, but as there were no | |||
| messages before, so no UIDs have actually changed, all the client | messages before, so no UIDs have actually changed, all the client | |||
| must do is accept the change in UIDVALIDITY. | must do is accept the change in UIDVALIDITY. | |||
| Alternatively, a server may force the client to re-select the | Alternatively, a server may force the client to re-select the | |||
| mailbox, at which time it will obtain a new UIDVALIDITY value. To do | mailbox, at which time it will obtain a new UIDVALIDITY value. To do | |||
| this, the server closes this client session (see "Severed | this, the server closes this client session (see "Severed | |||
| skipping to change at page 13, line 50 ¶ | skipping to change at page 14, line 5 ¶ | |||
| client's request.) | client's request.) | |||
| C: 002 FETCH 2 UID FLAGS INTERNALDATE | C: 002 FETCH 2 UID FLAGS INTERNALDATE | |||
| S: * 2 FETCH (INTERNALDATE "...") | S: * 2 FETCH (INTERNALDATE "...") | |||
| S: * 2 FETCH (UID 399) | S: * 2 FETCH (UID 399) | |||
| S: * 2 FETCH (FLAGS ()) | S: * 2 FETCH (FLAGS ()) | |||
| S: 002 OK done | S: 002 OK done | |||
| (In this case, the responses are in a different order and were | (In this case, the responses are in a different order and were | |||
| returned in separate responses.) | returned in separate responses.) | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| C: 003 FETCH 2 BODY[1] | C: 003 FETCH 2 BODY[1] | |||
| S: * 2 FETCH (FLAGS (\Seen) BODY[1] {14} | S: * 2 FETCH (FLAGS (\Seen) BODY[1] {14} | |||
| S: Hello world! | S: Hello world! | |||
| S: ) | S: ) | |||
| S: 003 OK done | S: 003 OK done | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| (In this case, the FLAGS response was added by the server, since | (In this case, the FLAGS response was added by the server, since | |||
| fetching the body part caused the server to set the \Seen flag.) | fetching the body part caused the server to set the \Seen flag.) | |||
| Because of this characteristic a client MUST be ready to receive any | Because of this characteristic a client MUST be ready to receive any | |||
| FETCH response at any time and should use that information to update | FETCH response at any time and should use that information to update | |||
| its local information about the message to which the FETCH response | its local information about the message to which the FETCH response | |||
| refers. A client MUST NOT assume that any FETCH responses will come | refers. A client MUST NOT assume that any FETCH responses will come | |||
| in any particular order, or even that any will come at all. If after | in any particular order, or even that any will come at all. If after | |||
| receiving the tagged response for a FETCH command the client finds | receiving the tagged response for a FETCH command the client finds | |||
| that it did not get all of the information requested, the client | that it did not get all of the information requested, the client | |||
| skipping to change at page 14, line 51 ¶ | skipping to change at page 15, line 5 ¶ | |||
| The protocol requires that the RFC822.SIZE value returned by the | The protocol requires that the RFC822.SIZE value returned by the | |||
| server be EXACT. Estimating the size is a protocol violation, and | server be EXACT. Estimating the size is a protocol violation, and | |||
| server designers must be aware that, despite the performance savings | server designers must be aware that, despite the performance savings | |||
| they might realize in using an estimate, this practice will cause | they might realize in using an estimate, this practice will cause | |||
| some clients to fail in various ways. If possible, the server SHOULD | some clients to fail in various ways. If possible, the server SHOULD | |||
| compute the RFC822.SIZE for a particular message once, and then save | compute the RFC822.SIZE for a particular message once, and then save | |||
| it for later retrieval. If that's not possible, the server MUST | it for later retrieval. If that's not possible, the server MUST | |||
| compute the value exactly every time. Incorrect estimates do cause | compute the value exactly every time. Incorrect estimates do cause | |||
| severe interoperability problems with some clients. | severe interoperability problems with some clients. | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| 3.4.6. Expunged Messages | 3.4.6. Expunged Messages | |||
| If the server allows multiple connections to the same mailbox, it is | If the server allows multiple connections to the same mailbox, it is | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| often possible for messages to be expunged in one client unbeknownst | often possible for messages to be expunged in one client unbeknownst | |||
| to another client. Since the server is not allowed to tell the | to another client. Since the server is not allowed to tell the | |||
| client about these expunged messages in response to a FETCH command, | client about these expunged messages in response to a FETCH command, | |||
| the server may have to deal with the issue of how to return | the server may have to deal with the issue of how to return | |||
| information about an expunged message. There was extensive | information about an expunged message. There was extensive | |||
| discussion about this issue, and the results of that discussion are | discussion about this issue, and the results of that discussion are | |||
| summarized in [RFC-2180]. See that reference for a detailed | summarized in [RFC-2180]. See that reference for a detailed | |||
| explanation and for recommendations. | explanation and for recommendations. | |||
| 3.4.7. The Namespace Issue | 3.4.7. The Namespace Issue | |||
| skipping to change at page 15, line 50 ¶ | skipping to change at page 16, line 5 ¶ | |||
| clients want to create a "Drafts" mailbox, an "Outbox" mailbox, or a | clients want to create a "Drafts" mailbox, an "Outbox" mailbox, or a | |||
| "Sent Mail" mailbox. And so on. There are two major | "Sent Mail" mailbox. And so on. There are two major | |||
| interoperability problems with this practice: | interoperability problems with this practice: | |||
| 1. different clients may use different names for mailboxes with | 1. different clients may use different names for mailboxes with | |||
| similar functions (such as "Trash" and "Deleted"), or may manage the | similar functions (such as "Trash" and "Deleted"), or may manage the | |||
| same mailboxes in different ways, causing problems if a user switches | same mailboxes in different ways, causing problems if a user switches | |||
| between clients and | between clients and | |||
| 2. there is no guarantee that the server will allow the creation of | 2. there is no guarantee that the server will allow the creation of | |||
| the desired mailbox. | the desired mailbox. | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| The client developer is, therefore, well advised to consider | The client developer is, therefore, well advised to consider | |||
| carefully the creation of any special-use mailboxes on the server, | carefully the creation of any special-use mailboxes on the server, | |||
| and, further, the client MUST NOT require such mailbox creation - | and, further, the client MUST NOT require such mailbox creation - | |||
| that is, if you do decide to do this, you MUST handle gracefully the | that is, if you do decide to do this, you MUST handle gracefully the | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| failure of the CREATE command and behave reasonably when your | failure of the CREATE command and behave reasonably when your | |||
| special-use mailboxes do not exist and can not be created. | special-use mailboxes do not exist and can not be created. | |||
| In addition, the client developer SHOULD provide a convenient way for | In addition, the client developer SHOULD provide a convenient way for | |||
| the user to select the names for any special-use mailboxes, allowing | the user to select the names for any special-use mailboxes, allowing | |||
| the user to make these names the same in all clients s/he uses and to | the user to make these names the same in all clients s/he uses and to | |||
| put them where s/he wants them. | put them where s/he wants them. | |||
| 3.4.9. Reference Names in the LIST Command | 3.4.9. Reference Names in the LIST Command | |||
| skipping to change at page 16, line 50 ¶ | skipping to change at page 17, line 4 ¶ | |||
| simply do not understand it and misuse it, do not use it, or ignore | simply do not understand it and misuse it, do not use it, or ignore | |||
| it as a result. | it as a result. | |||
| The following statement gets somewhat into the religious issues that | The following statement gets somewhat into the religious issues that | |||
| we've tried to avoid scrupulously here; so be it: because of the | we've tried to avoid scrupulously here; so be it: because of the | |||
| confusion around the reference name, its use by a client is a | confusion around the reference name, its use by a client is a | |||
| dangerous thing, prone to result in interoperability problems. There | dangerous thing, prone to result in interoperability problems. There | |||
| are servers that interpret it as originally intended; there are | are servers that interpret it as originally intended; there are | |||
| servers that ignore it completely; there are servers that simply | servers that ignore it completely; there are servers that simply | |||
| prepend it to the mailbox name (with or without inserting a hierarchy | prepend it to the mailbox name (with or without inserting a hierarchy | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| delimiter in between). Because a client can't know which of these | delimiter in between). Because a client can't know which of these | |||
| four behaviours to expect, a client SHOULD NOT use a reference name | four behaviours to expect, a client SHOULD NOT use a reference name | |||
| itself, expecting a particular server behavior. However, a client | itself, expecting a particular server behavior. However, a client | |||
| SHOULD permit a USER, by configuration, to use a reference name. | SHOULD permit a USER, by configuration, to use a reference name. | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| There is in no way universal agreement about the use or non-use of | There is in no way universal agreement about the use or non-use of | |||
| the reference name. The last words here are, "Be aware." | the reference name. The last words here are, "Be aware." | |||
| 3.4.10. Deleting Mailboxes | 3.4.10. Deleting Mailboxes | |||
| The protocol does not guarantee that a client may delete a mailbox | The protocol does not guarantee that a client may delete a mailbox | |||
| that is not empty, though on some servers it is permissible and is, | that is not empty, though on some servers it is permissible and is, | |||
| in fact, much faster than the alternative or deleting all the | in fact, much faster than the alternative or deleting all the | |||
| messages from the client. If the client chooses to try to take | messages from the client. If the client chooses to try to take | |||
| advantage of this possibility it MUST be prepared to use the other | advantage of this possibility it MUST be prepared to use the other | |||
| method in the even that the more convenient one fails. Further, a | method in the even that the more convenient one fails. Further, a | |||
| client SHOULD NOT try to delete the mailbox that it has selected, but | client SHOULD NOT try to delete the mailbox that it has selected, but | |||
| should first close that mailbox; some servers do not permit the | should first close that mailbox; some servers do not permit the | |||
| deletion of the selected mailbox. | deletion of the selected mailbox. | |||
| That said, a server SHOULD permit the deletion of a non-empty | ||||
| mailbox; there's little reason to pass this work on to the client. | ||||
| Moreover, forbidding this prevents the deletion of a mailbox that for | ||||
| some reason can not be opened or expunged, leading to possible | ||||
| denial-of-service problems. | ||||
| Example: | Example: | |||
| [User tells the client to delete mailbox BANANA, which is | [User tells the client to delete mailbox BANANA, which is | |||
| currently selected...] | currently selected...] | |||
| C: 008 CLOSE | C: 008 CLOSE | |||
| S: 008 OK done | S: 008 OK done | |||
| C: 009 DELETE BANANA | C: 009 DELETE BANANA | |||
| S: 009 NO Delete failed; mailbox is not empty. | S: 009 NO Delete failed; mailbox is not empty. | |||
| C: 010 SELECT BANANA | C: 010 SELECT BANANA | |||
| S: * ... untagged SELECT responses | S: * ... untagged SELECT responses | |||
| S: 010 OK done | S: 010 OK done | |||
| skipping to change at page 17, line 43 ¶ | skipping to change at page 18, line 4 ¶ | |||
| S: 011 OK done | S: 011 OK done | |||
| C: 012 CLOSE | C: 012 CLOSE | |||
| S: 012 OK done | S: 012 OK done | |||
| C: 013 DELETE BANANA | C: 013 DELETE BANANA | |||
| S: 013 OK done | S: 013 OK done | |||
| 3.5. A Word About Testing | 3.5. A Word About Testing | |||
| Since the whole point of IMAP is interoperability, and since | Since the whole point of IMAP is interoperability, and since | |||
| interoperability can not be tested in a vacuum, the final | interoperability can not be tested in a vacuum, the final | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| recommendation of this treatise is, "Test against EVERYTHING." Test | recommendation of this treatise is, "Test against EVERYTHING." Test | |||
| your client against every server you can get an account on. Test | your client against every server you can get an account on. Test | |||
| your server with every client you can get your hands on. Many | your server with every client you can get your hands on. Many | |||
| clients make limited test versions available on the Web for the | clients make limited test versions available on the Web for the | |||
| downloading. Many server owners will give serious client developers | downloading. Many server owners will give serious client developers | |||
| guest accounts for testing. Contact them and ask. NEVER assume that | guest accounts for testing. Contact them and ask. NEVER assume that | |||
| because your client works with one or two servers, or because your | because your client works with one or two servers, or because your | |||
| server does fine with one or two clients, you will interoperate well | server does fine with one or two clients, you will interoperate well | |||
| in general. | in general. | |||
| In particular, in addition to everything else, be sure to test | In particular, in addition to everything else, be sure to test | |||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| against the reference implementations: the PINE client, the | against the reference implementations: the PINE client, the | |||
| University of Washington server, and the Cyrus server. | University of Washington server, and the Cyrus server. | |||
| See the following URLs on the web for more information here: | See the following URLs on the web for more information here: | |||
| IMAP Products and Sources: http://www.imap.org/products.html | IMAP Products and Sources: http://www.imap.org/products.html | |||
| IMC MailConnect: http://www.imc.org/imc-mailconnect | IMC MailConnect: http://www.imc.org/imc-mailconnect | |||
| 4. Security Considerations | 4. Security Considerations | |||
| This document describes behaviour of clients and servers that use the | This document describes behaviour of clients and servers that use the | |||
| skipping to change at page 18, line 36 ¶ | skipping to change at page 18, line 47 ¶ | |||
| Requirement Levels", RFC 2119, Harvard University, March 1997. | Requirement Levels", RFC 2119, Harvard University, March 1997. | |||
| [RFC-2180], Gahrns, M., "IMAP4 Multi-Accessed Mailbox Practice", RFC | [RFC-2180], Gahrns, M., "IMAP4 Multi-Accessed Mailbox Practice", RFC | |||
| 2180, Microsoft, July 1997. | 2180, Microsoft, July 1997. | |||
| [NAMESPACE], Gahrns, M. & Newman, C., "IMAP4 Namespace", draft | [NAMESPACE], Gahrns, M. & Newman, C., "IMAP4 Namespace", draft | |||
| document <draft-gahrns-imap-namespace-01.txt>, June 1997. | document <draft-gahrns-imap-namespace-01.txt>, June 1997. | |||
| 6. Acknowledgments | 6. Acknowledgments | |||
| To be completed... | This document is the result of discussions on the IMAP4 mailing list and | |||
| is meant to reflect consensus of this group. In particular, Mark | ||||
| Crispin, Steve Hole, and Portia Shao made significant comments or | ||||
| suggestions during the review of this document. | ||||
| Internet DRAFT Implementation Recommendations September 1997 | ||||
| 7. Author's Address | 7. Author's Address | |||
| Barry Leiba | Barry Leiba | |||
| IBM T.J. Watson Research Center | IBM T.J. Watson Research Center | |||
| 30 Saw Mill River Road | 30 Saw Mill River Road | |||
| Hawthorne, NY 10532 | Hawthorne, NY 10532 | |||
| Phone: 1-914-784-7941 | Phone: 1-914-784-7941 | |||
| Email: leiba@watson.ibm.com | Email: leiba@watson.ibm.com | |||
| End of changes. 36 change blocks. | ||||
| 37 lines changed or deleted | 48 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||