You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



You are here: Mozilla MailNews Functional / UI Tests > Mail & News: IMAP Commands and Implementation

Feature Test Spec: Mail and News Component

Mail and News Component: IMAP Commands and Implementation

Written by Karen Huang

References

IMAP4rel RFC 2060
IMAP4 Implementation Recommendations
UI Specification: TBD

Description

This Test Spec describes the IMAP Command Execution and Implementation.

Table of Contents

Server Prioritization

IMAP servers Version Notes
1 Netscape Messaging Server 4.1 Internal Server Name: dredd/nsmail-2 or tintin/nsmail-5 (Aug.99~current)
2 Microsoft Exchange v5.5 Internal Server Name: poisonoak (2/3/99~current )
3 University of Washington v12.250 Internal Server Name: sspitzer
4 Cyrus v1.5.2 Internal Server Name: buggy (2/3/99~current )
* SIMS/IMS 4.0/5.0 SUN Microsystems covered this test already

IMAP Log File Setup

The log is written over every time you re-launch Communicator for all the following platforms:

  • Windows 95/98 :
    • Create "c:\tmp" for IMAP log file reside if there is no such directory
    • Insert the following line into your autoexec.bat file:
      Set NSPR_LOG_MODULES=IMAP:5
      Set NSPR_LOG_FILE=c:\tmp\[filename]
      (filename can be defined by you)
    • Reboot your system
  • WinNT:
    • Create "c:\tmp" for IMAP log file reside if there is no such directory
    • Use the control panel | System | Environment tool to set the PRLOG env variable:
      Varibles: NSPR_LOG_MODULES Value: IMAP:5
      Varibles: NSPR_LOG_FILE Value: c:\tmp\[filename]
      (filename can be defined by you)
    • Reboot your system
  • Unix:
    • Add a line to ~/.cshrc file of the csh shell as following:
      Set NSPR_LOG_MODULES IMAP:5
      Set NSPR_LOG_FILE /u/[unix userlogin]/tmp/[filename]
      (filename can be defined by you)
    • Add a line to ~/.bashrc file of the csh shell as following:
      NSPR_LOG_MODULES="IMAP:5"
      NSPR_LOG_FILE="/u/[unix userlogin]/tmp/[filename]
      export NSPR_LOG_MODULES
      export NSPR_LOG_FILE
      (filename can be defined by you)

      Please Note: /u/[unix userlogin] is just Netscape setup UNIX environment for each user. It could be /home/[unix userlogin] or /[unix userlogin] depend on how your users environment setup.

  • Mac:

    Create a text file that contains the following lines in a text editor (ex: BBEdit) After save this file, drag and drop this file on the Netscape/Mozilla application icon, the log file will be created from the seamonkey folder.
    ARGS:-mail
    ENV:NSPR_LOG_MODULES=IMAP:5
    ENV:NSPR_LOG_FILE=[filename]

IMAP Commands and Execution

  1. CAPABILITY
    Server MUST send a single untagged CAPABILITY response with "IMAP4rel1" as one of the listed capabilities before the (tagged) OK response
    1. Confirm that on initial connect, a CAPABILITY command is issued by the client => IMAP log shows CAPABILITY command/listing and its response from the server
    2. Respect lack of NAMESPACE response
      • (Note: Don't ask for namespaces if the server has told us they don't support namespaces. Old Netscape servers don't send this response)
      • => If the server has not returned "NAMESPACE" in their reply, we don't follow up with a "namespace" command shortly after connecting.
    3. Respect lack of X-NETSCAPE response
      • (Note: Recent Netscape servers send us the XSERVERINFO response. I think that's what triggers us to know that we can offer client-based server admin.)
      • => If the server has not sent us the XSERVERINFO in the capability response,we shouldn't ask for "XSERVERINFO MANAGEACCOUNTURL MANAGELISTSURL MANAGEFILTERSURL."
  2. LOGIN/AUTHENTICATE:
    1. Login when the sever is down. => Appropriate timeout/error message/note and confirmation
    2. Cancel login before entering the username and the password. => Shold drop the connection to the server
    3. Username/Password combination:
      1. Correct password => IMAP log shows LOGIN OK
      2. Incorrect password
  3. NAMESPACE
    1. (If the server responded with NAMESPACE in its capability statement) issue a namespace command.(Note: I THINK we're supporting multiple namespaces in mail5, UI TBD for all of this stuff) => Check the IMAP log for the namespace command which followed by the server's response - IMAP log should show namespace request
    2. LSUB additional namespaces on connect (for servers that support namespaces): (Note: We should show an LSUB in the IMAP log for each namespace that the server has told us about) => LSUB for each namespace - Confirm that the folders that exist in each namespace appear in the folder pane and are selectable/usable by the user.
    3. Load a folder that's in a non-default namespace. (Note: Supported namespace types in mail5 TBD. I think we're still going to offer other user's and shared namespaces. More granularity of test cases after a spec comes out)
    4. Create a new folder in a non-default namespace.
    5. Delete a folder in a non-default namespace.
    6. Copy a message to a folder in a non-default namespace from the default namespace.
    7. Copy a message to a folder in a non-default namespace from the default namespace.
    8. Drag and drop a folder from the default namespace to a non-default namespace.
    9. Drag and drop a folder from a non-default namespace to the default namespace.
    10. Change namespace settings => Change may require a restart, but should be successful. Note steps necessary for success; if not very easy, confirm requirement w/eng.
    11. Make personal namespace be something other than the user's server home
  4. SELECT / initial FETCH (fetch flags, headers)
    1. Inbox:
      • When a user selects a folder, the server will return the following information:
        * select "INBOX"
        * FLAGS (\Answered \Flagged\Draft \Deleted \Seen $Forwarded $MDNSent)
        * OK [PERMANENTFLAGS(\Answered \Flagged \Draft\Deleted \Seen $Forwarded $MDNSent \*)]
        * 4 EXISTS
        * 0 RECENT
        * OK [UIDVALIDITY 904023909]
        * OK [READ-WRITE] Completed
      • Note: To the user, selecting is performed by clicking on a folder. The IMAP log will show the client running an URL, e.g., URL: Loading IMAP://tintin?select>/INBOX >. (This test case will actually test SELECT and several different forms of FETCH executed by that URL.)

        Being, in order, a listing of the defined types of flag for that folder; a listing of the types of permanent flag that are possible; how many messages exist; how many of those messages are recent (ones the user has not yet seen the headers of); the UIDVALIDITY (must be sent by the server for all FETCH responses,but we don't do anything with it to the best of my knowledge; and the success of selecting the folder in, hopefully, read-write mode. After the Select returns OK, we do a UID fetch 1* (FLAGS), which causes the server to return the flags and UIDs for each of the messages in that folder. Next, we do a fetch for all of the headers for all of the messages in the folder, in order to have to information to populate the thread pane. (However, if the summary file already contains that information for some of the messages, the request tothe server is only made for those messages that are unknown to it, as in "11 UID fetch 11564:11572 (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS

        (From To Cc Subject Date Priority X-Priority Message-ID References Newsgroups Return-Receipt-To Disposition-Notification-To)])"

        Finally (if the first message is to be automatically loaded upon folder selection), we fetch the body for the first message, as in

        " 19 UID fetch 11550 (XSENDER UID RFC822.SIZE BODY[])" When testing, confirm that all of the headers and flags are displayed in the UI as expected.

    2. Default folders
      1. Sent folder. (Note: If not specified, the folder named is presumed to be in a subscribed state)
      2. Trash folder.
      3. Drafts folder
      4. Templates folder
    3. Generic top-level folder
    4. NoSelect top-level folder (Note:NoSelect folders shouldn't be selectable)
    5. Subscribed folder
    6. Unsubscribed folder (Not yet defined whether we'll be displaying unsubscribed folders
      1. Subscribed subfolder where parent folder isn't subscribed
    7. Top-level folder in a specified IMAP directory (off of the user's home directory on the server)
    8. Second-level folder:
      1. Subfolder of Inbox (No such thing with Messaging server)
      2. Subfolder in a specified IMAP directory
    9. Empty folder => All expected communications between server and folder should appear in the IMAP log, though there are no messages.
    10. Folders Stress Test:
      1. Folder 20 levels deep
      2. Folder that has been deleted by another client that has a concurrent session open to this account => Appropriate error message (folder does not exist). We may choose to remove this folder from the display immediately, or at the next restart. That issue is covered more specifically in the DELETE section.
      3. Folder containing 10k messages => Note time taken. Confirm appropriateness of behavior w/development.
      4. Folder containing 500 message-containing subfolders.
      5. Folder that is selected by another client that has a concurrent session open to this folder => No error; I think the folder will be opened as read-only, though, not read-write. Check log, try to delete message while folder is selected to see if its contents can be modified. Confirm appropriateness of behavior w/development.
  5. FETCH (body):
    1. Plain text message (Note: Fetching a message body is also initiated with an URL. This one looks like: URL: Loading IMAP://tintin?fetch>UID>/INBOX>11501)
      => The IMAP log will show a line that looks like: 12 UID fetch 11501 (XSENDER
      UID RFC822.SIZE BODY[]. At the end of the message, there will appear
      something like: "tintin:S-INBOX:STREAM:CLOSE: Normal Message End Download Stream STREAM: Normal End Message Download Stream Event
      12 OK Completed" Make sure there are no errors in the log, and that the message view pane.
    2. HTML message
    3. Message with vcard
    4. Message with sig
    5. Signed message
    6. Encrypted message
    7. Signed and encrypted message
    8. Message with attached web page
    9. Message with base64 attachment
    10. Message with unencoded attachment
    11. Message with extremely long subject line (300 chars?)
    12. Message with extremely long to: list
    13. (rows left to add cases related tovarious TBD preferences that may affect fetching)
    14. Message Stress Test:
      1. Message with large attachment (5MB) (Note: Some mail servers are set up to limit the size of attachments that it routes. If this test fails, first check the server settingsto see if it has imposed a limit.
      2. Message with base64 attachment (Note: I don't think the form of encoding would make any difference to FETCHING it, but it can't hurt to include these tests; it might turn up other problems, anyway.
  6. FETCH (biff)
    1. You've got mail! (Note: When we check for new mail, we do this by trying to fetch any messages with a message ID of the next expected one and higher. => An example that shows the client finding out about one new message, then asking for its headers:
      21 UID fetch 11573:
      * (FLAGS)
      * 14 FETCH (FLAGS (\Recent) UID 11573) 21 OK Completed
      22 UID fetch 11573 (UID RFC822.SIZE FLAGS BODY.PEEK[HEADER.FIELDS (From To Cc Subject Date Priority X-Priority Message-ID References Newsgroups Return-Receipt-To Disposition-Notification-To)])
    2. No new mail. => An example that shows the client finding out that there are no new messages. The server tells us that the last message is the one we already know about:
      24 UID fetch 11574:* (FLAGS)
      * 14 FETCH (FLAGS (\Recent) UID 11573)
      24 OK Completed
    3. Multiple new messages => Example follows. Note the format of the message header fetch for multiple UIDs.
      30 UID fetch 11615:* (FLAGS)
      * 9 FETCH (FLAGS (\Recent) UID 11615)
      * 10 FETCH (FLAGS (\Recent) UID 11616)
      * 11 FETCH (FLAGS (\Recent) UID 11617)
      30 OK Completed
      31 UID fetch 11615:11617(UID RFC822.SIZE
      FLAGS BODY.PEEK[HEADER.FIELDS
      (From To Cc Subject Date Priority X-Priority
      Message-ID References Newsgroups
      Return-Receipt-To
      Disposition-Notification-To)])
    4. A new message that was already marked read by another client with a concurrent connection to the account => [get log example...pretty much the same, except there won't be a \Recent flag.]
  7. STORE
    1. Add \Answered flag: (Note: Store is used to add flags to a message. This flag can be added by responding to a message. It's also initiated with an URL, such as URL: Loading IMAP://tintin?addmsgflags>UID>/INBOX>11602>2
      => The next time the folder is selected, it should show an /Answered flag
      with the message. The actual store will look something like this:
      20 uid store 11602 +Flags (\Answered) * 5 FETCH (FLAGS (\Recent\Answered \Seen) UID 11602) 20 OK Completed IMHO, for all of
      these STORE tests, it's best to do a full restart when checkingthem...that will show not only that the flag was added, but that the addition successfully carries over between sessions.[note: check temp flag info in RFC]
    2. Add \Flagged: (Note: This flag can be added by flagging a message.)
    3. Add \Draft : (Note: [check])
    4. Add \Deleted: (Note: This flag can be added by deleting a message with either the IMAP or move-to-trash delete models.) => If mail5 automatically expunges at exit, permanence of this flag may not be able to be checked after a restart.
    5. Add \Seen: (Note: This flag can be added by displaying a message.)
    6. Add $Forwarded (Note: This flag can be added by forwarding a message.)
    7. Add $MDNSent (Note: This flag can be added by responding to a message.)
    8. Remove\Flagged (Note: Use whatever UI mech is available to unflag.) => Remove flags actions are just like flag additions, except for the value of the sign: 20 uid store 11602 -Flags (\Flagged)
    9. Remove\Deleted (Note: Use undo, assuming there is one in the UI )
    10. Remove \Seen (Note:Mark message as unread)
    11. Add multiple flags to the same messagein the same session (Note: There's no reason you couldn't add them all in a session.) => All flags should be successfully added.
    12. Remove multiple flags in the same session (Note: All of the removable flags should be able to be deleted in a given session.
  8. UID: (Note: Test cases for the UID command are inherent in the tests written for FETCH, STORE, COPY, and SEARCH test cases.)
  9. UIDVALIDITY
    1. Any change of unique identifiers between sessions MUST be detectable using the UIDVALIDITY mechanism.
      1. The next unique identifer value will not change unless new messages are added to the mailbox.
      2. The next unique identifer value will change whenever new message are added to the mailbox, even if those new messages are subsequently expunged
      3. The unique identifer validity value is sent in an UIDVALIDITY response code in an OK untagged response at mailbox selection time. If unique identifer from an earlier session fail to persist to this session, the unique identifer validity value MUST be greater than the one used in the earlier session.
        • Test for one IMAP client
        • Test for IMAP Multiple-clients
  10. LIST
    1. LIST a specific folder (Note: The LIST command returns information about a folder or about a subset of folders, based on what was passed in as a parameter. In its simplest form, we ask it about a particular folder. LISTing the INBOX happens every time we connect, near the beginning of the log.) => 7 list "" "INBOX" The server passes back
      information about the folder's name attributes, hierarchy delimiter, and name:
      * LIST (\NoInferiors) "/" INBOX 7 OK Completed
    2. List a subfolder of a regular folder => 5 list "" "personal/sub_of_personal" , followed by the server response:
      * LIST (\HasNoChildren) "/" personal/sub_of_personal 5 OK Completed
    3. LIST a /NoSelect folder (Note: Have a /NoSelect folder in your top-level hierarchy. Collapse and expand your server hierarchy (if such an action is supported by the UI) The /NoSelect folder will be LISTed.) => 6 list "" "noselect" No detailed information will be
      returned, only the "OK." 6 OK Completed.
    4. LIST a subfolder of a /NoSelect folder (Note: Create a folder and subfolder simultaneously, i.e., "folderone/foldertwo". The higher-level one will be created as a /NoSelect folder. Immediately after the subfolder is created, it will be LISTed.)
      => 5 list "" "noselect/subfolder" Same type of result as for a subfolder of a regular folder:
      * LIST (\HasNoChildren) "/" noselect/subfolder 5 OK Completed
    5. LIST with subscription turned off (Note: This list will be preceded by the URL "URL:Loading IMAP://[servername]?discoverallboxes"
      => 18 list "" "%" This will return information for all top-level folders, then an OK. Immediatly after that, we'll request information for the next level of the hierarchy down:
    6. 19 list "" "%/%", which will cause to be returned all folder information for the second level of folders in the hierarchy.
  11. LSUB
    1. Initial LSUB on connection to an account
      (Note: LSUB shows which folders are subscribed to by the user. It shouldn't matter if the folder was subscribed to by any particular client; the folder is either subscribed or it's not.)
      => 5 lsub "" "*" followed by the server's list of all subscribed mailboxes.
    2. Subscription turned off => No LSUBs should appear in the log.
    3. LSUB when subscribe window is opened.
      (Note: [subscribe window may be totally different in mail5]
      We begin with the URL: URL: Loading IMAP://tintin?discoverallandsubscribedboxes)
      => 8 lsub "" "*" [server responds with list of all subscribed]
      9 list "" "%" [server responds with list of all top-level folders]
    4. folders] 10 list "" "%/%" [server responds with list of all second-level folders]
  12. CREATE
    1. CREATE single top-level folder => Folder should be created and subscribed.
    2. CREATE container folder & subfolder simultaneously => Folders should be created, and the non-NoSelect folder should be subscribed.
    3. CREATE folder with subscription turned off
      (Note: I think I remember some controversy over this. Double-check bug database.) => Folder should not be subscribed?
    4. CREATE subfolder of a folder that already contains messages => Subfolder should be created and subscribed.
    5. Stress Test:
      1. CREATE folder 20 levels deep => Folder should be created and subscribed.
  13. DELETE
    1. DELETE single top-level folder when the folder is selected
      (Note: This section is for deletion of folders. Deletion of messages is
      handled through the use of the /Deleted flag (see STORE section of test) => Successful delete.
    2. DELETE container folder & subfolder simultaneously when the subfolder is selected => Successful delete.
    3. DELETE subfolder of a folder that already contains messages when the folder is selected => Successful delete.
    4. DELETE parent folder with multiple subfolders => Successful delete.
    5. DELETE subscribed folder => Successful delete.
      DELETE unsubscribed folder (Note: Subscription will probably have to be turned off in order to see the folder, but that's really a UI issue, and TBD) => Successful delete.
  14. RENAME
    1. RENAME single top-level folder when the folder is selected => Successful delete.
    1. RENAME parent folder containing a subfolder with messages
    2. RENAME parent folder with multiple subfolders
    3. RENAME subfolder
    4. RENAME a subscribed folder
    5. RENAME an unsubscribed folder (Note: Subscription will probably have to be turned off in order to see the folder, but that's really a UI issue, and TBD)
    6. Stress test:
      RENAME a folder 20 levels deep
  15. APPEND
    1. APPEND message to INBOX (Note: Ensure that flags, time, date are preserved.) => Successful Append
    2. APPEND message to non-inbox, top-level folder
    3. APPEND message to subfolder of NoSelect folder
    4. APPEND message to subfolder of dual-use folder
    5. APPEND message to NoSelect folder (Note: UI may not allow attempting this) => Appropriate error message.
    6. APPEND large message (5MB) to a folder.
    7. APPEND message to folder from another server
    8. Stress Test:
    9. APPEND message to folder 20 levels deep.
  16. NOOP
    1. Note: Noop is performed to synch mailbox states; it doesn't do anything, though other IMAP commands may be spurred by it. There isn't much to test with it except to check and make sure that we're not using them excessively (which is a subjective call). If there are a lot of noops in the log, check with a developer.
  17. CHECK
    1. Note: This command is similar to NOOP. I'm not positive why we use it...it might be related to synching mailbox state to resolve issues related to multiple clients using one account. Will add test cases
    2. if/when it becomes necessary. In any case, it's a housekeeping command not related to the success or failure of performing the manual actions that the user initiates.
  18. EXPUNGE
    1. Expunge automatically; threshold-triggered
      (Note: This command purges folders of deleted messages. This test case focuses on the automatic purge of every folder that occurs when a folder is opened and it has more than the allowed limit of deleted messages) => The folder EXPUNGE is done, then the folder is normally selected and the first message loaded.
    2. Expunge inbox at exit (Note:This may be a preference in mail5. If it's a settable preference, check both positive and negativ) => The INBOX is expunged at application exit.
    3. Expunge manually (Note:There may be some sort of "expunge/compress/compact folder" menu item. It may be context-sensitive, allowing more than one folder to be selected when it is used. Test whatever makes sense when the UI is developed)
    4. Expunge a folder while another client has a connection to it => Successful expunge. Other client should notice on next NOOP, CHECK, or biff (FETCH)
    5. Empty trash should expunge trash folder (Note: Only relevant for trash delete model) => Successful expunge
    6. Empty trash while trash folder is selected => Successful expunge
  19. COPY
    1. COPY message from one top-level folder to another (Note: Ensure that flags, time, date are preserved) => Successful copy
    2. COPY message into a subfolder of the source folder
    3. COPY message into the parent folder of the source folder
    4. Stress Test:
      1. COPY message into a folder 20 levels deep
    5. COPY message into each of the special folders (inbox, trash, sent, templates, drafts)
    6. COPY message from one IMAP server to another
    7. COPY message to nonexistent folder (Note: Delete the folder with another client attached to the account) => Appropriate error message.
    8. COPY large message (5MB) from one folder to another
  20. SUBSCRIBE
    1. Subscribe to a top-level folder that is currently unsubscribed (Note: Many of the possibilities of this component will be defined by the yet to-be-designed UI)
    2. Try to subscribe to a NoSelect folder => Should not be possible
    3. Subscribe to a subfolder when the parent folder is subscribed
    4. Subscribe to a subfolder when the parent folder is not subscribed
    5. Subscribe to a folder three levels down when all parent folders are not subscribed
    6. Subscribe to a folder when subscription is turned off (Note: This may or may not be possible)
    7. Subscribe to a folder (when subscription is turned off) and the folder is currently selected
    8. Subscribe to a empty folder
    9. Subscribe to a folder with 10k messages
    10. Stress Test:
      1. Subscribe to a folder twenty levels deep
  21. UNSUBSCRIBE
    1. Unsubscribe from a top-level folder that is currently subscribed
    2. Try to unsubscribe from a NoSelect folder => Shouldn't be possible
    3. Unsubscribe from a subfolder when the parent folder is subscribed
    4. Unsubscribe from a subfolder when the parent folder is not subscribed
    5. Unsubscribe from a folder three levels down when all parent folders are not subscribed
    6. Unsubscribe froma folder when subscription is turned off
    7. Unsubscribe from a folder when the folder is currently selected
    8. Unsubscribe from an empty folder
    9. Unsubscribe from a folder with 10k messages
    10. Unsubscribe froma folder twenty levels deep
  22. SEARCH
    1. SEARCH one folder (Note: Many of these test cases will be influenced by the formation of the UI)
    2. SEARCH multiple folders (in a hierarchy)
    3. SEARCH a NoSelect folder => Shouldn't be possible
    4. SEARCH an unsubscribed folder (Note: May need to have subscription turned off to do this)
    5. SEARCH for non-ascii characters
    6. SEARCH a folder with 10k messages
    7. Stress Test:
      1. SEARCH a folder twenty levels deep
  23. LOGOUT
    1. At application exit (Note: Logging out will occur at the end of a session and whenever a connection to an inbox is intentionally stopped, as when the user doesn't want to wait for a large message to finish downloading, and presses Stop. This test case is to make sure that we logout when the application exits. Check the end of the IMAP log.) => Last lines should be something like:
      HOST?:S-INBOX:NET:WR: xxxx logout
      mozilla IMAP stdout:
      HOST?:S-INBOX:CONTROL:From
      TellThreadToDie: LOGOUT
    2. During folder load (Note: Press Stop while a folder's headers are downloading (after selecting it, before all of the threads have displayed. This may be easiest to do the first time loading a folder after filing a lot of messages to it, like Trash, or by exiting, deleting the summary file, restarting, then selecting the folder. => INTERRUPT Entered
    3. tintin:S-Trash:NET:WR: xxxx logout

Additional Special Tests

  1. Upgrade to mail5 with an account that had been used with a client that supports subscription, such as 4.5 (Note: No "subscription wizard" kind of thing has been designed yet for mail5) => TBD
  2. Upgrade to mail5 with an account that had been used with a client that does not support subscription, such as 4.0x. => TBD
  3. Stop actions while they're being performed. => Mail should work fine, new summary files generated.
  4. Delete local summary files and start mail. => Mail should work fine, new summary files generated.
  5. Use mail5 in a perfectly clean setup...no local mailfiles, brand new server account. => Mail should work fine.
  6. Send and receive unusual-content mail.
  7. (Note: Include vcards, signed & encrypted mails, and mails with different attachment types.) => Mail should work fine.