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 HuangReferences
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.
- Add a line to ~/.cshrc file of the csh shell as following:
-
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
-
CAPABILITY
Server MUST send a single untagged CAPABILITY response with "IMAP4rel1" as one of the listed capabilities before the (tagged) OK response- 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
- 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.
- 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."
-
LOGIN/AUTHENTICATE:
- Login when the sever is down. => Appropriate timeout/error message/note and confirmation
- Cancel login before entering the username and the password. => Shold drop the connection to the server
- Username/Password combination:
- Correct password => IMAP log shows LOGIN OK
- Incorrect password
-
NAMESPACE
- (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
- 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.
- 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)
- Create a new folder in a non-default namespace.
- Delete a folder in a non-default namespace.
- Copy a message to a folder in a non-default namespace from the default namespace.
- Copy a message to a folder in a non-default namespace from the default namespace.
- Drag and drop a folder from the default namespace to a non-default namespace.
- Drag and drop a folder from a non-default namespace to the default namespace.
- 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.
- Make personal namespace be something other than the user's server home
-
SELECT /
initial FETCH (fetch flags, headers)
- 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.
- When a user selects a folder, the server will return the
following information:
- Default folders
- Sent folder. (Note: If not specified, the folder named is presumed to be in a subscribed state)
- Trash folder.
- Drafts folder
- Templates folder
- Generic top-level folder
- NoSelect top-level folder (Note:NoSelect folders shouldn't be selectable)
- Subscribed folder
- Unsubscribed folder (Not yet defined whether we'll be
displaying unsubscribed folders
- Subscribed subfolder where parent folder isn't subscribed
- Top-level folder in a specified IMAP directory (off of the user's home directory on the server)
- Second-level folder:
- Subfolder of Inbox (No such thing with Messaging server)
- Subfolder in a specified IMAP directory
- Empty folder => All expected communications between server and folder should appear in the IMAP log, though there are no messages.
- Folders Stress Test:
- Folder 20 levels deep
- 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.
- Folder containing 10k messages => Note time taken. Confirm appropriateness of behavior w/development.
- Folder containing 500 message-containing subfolders.
- 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.
- Inbox:
-
FETCH (body):
- 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. - HTML message
- Message with vcard
- Message with sig
- Signed message
- Encrypted message
- Signed and encrypted message
- Message with attached web page
- Message with base64 attachment
- Message with unencoded attachment
- Message with extremely long subject line (300 chars?)
- Message with extremely long to: list
- (rows left to add cases related tovarious TBD preferences that may affect fetching)
- Message Stress Test:
- 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.
- 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.
- 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)
-
FETCH (biff)
- 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)]) - 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 - 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)]) - 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.]
- 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:
-
STORE
- 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] - Add \Flagged: (Note: This flag can be added by flagging a message.)
- Add \Draft : (Note: [check])
- 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.
- Add \Seen: (Note: This flag can be added by displaying a message.)
- Add $Forwarded (Note: This flag can be added by forwarding a message.)
- Add $MDNSent (Note: This flag can be added by responding to a message.)
- 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)
- Remove\Deleted (Note: Use undo, assuming there is one in the UI )
- Remove \Seen (Note:Mark message as unread)
- 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.
- Remove multiple flags in the same session (Note: All of the removable flags should be able to be deleted in a given session.
- 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
- UID: (Note: Test cases for the UID command are inherent in the tests written for FETCH, STORE, COPY, and SEARCH test cases.)
-
UIDVALIDITY
- Any change of unique identifiers between sessions MUST be
detectable using the UIDVALIDITY mechanism.
- The next unique identifer value will not change unless new messages are added to the mailbox.
- The next unique identifer value will change whenever new message are added to the mailbox, even if those new messages are subsequently expunged
- 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
- Any change of unique identifiers between sessions MUST be
detectable using the UIDVALIDITY mechanism.
-
LIST
- 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 - 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 - 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. - 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 - 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: - 19 list "" "%/%", which will cause to be returned all folder information for the second level of folders in the hierarchy.
- 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
-
LSUB
- 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. - Subscription turned off => No LSUBs should appear in the log.
- 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] - folders] 10 list "" "%/%" [server responds with list of all second-level folders]
- Initial LSUB on connection to an account
-
CREATE
- CREATE single top-level folder => Folder should be created and subscribed.
- CREATE container folder & subfolder simultaneously => Folders should be created, and the non-NoSelect folder should be subscribed.
- CREATE folder with subscription turned off
(Note: I think I remember some controversy over this. Double-check bug database.) => Folder should not be subscribed? - CREATE subfolder of a folder that already contains messages => Subfolder should be created and subscribed.
- Stress Test:
- CREATE folder 20 levels deep => Folder should be created and subscribed.
-
DELETE
- 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. - DELETE container folder & subfolder simultaneously when the subfolder is selected => Successful delete.
- DELETE subfolder of a folder that already contains messages when the folder is selected => Successful delete.
- DELETE parent folder with multiple subfolders => Successful delete.
- 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.
- DELETE single top-level folder when the folder is
selected
-
RENAME
- RENAME single top-level folder when the folder is selected => Successful delete.
- RENAME parent folder containing a subfolder with messages
- RENAME parent folder with multiple subfolders
- RENAME subfolder
- RENAME a subscribed folder
- 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)
- Stress test:
RENAME a folder 20 levels deep
-
APPEND
- APPEND message to INBOX (Note: Ensure that flags, time, date are preserved.) => Successful Append
- APPEND message to non-inbox, top-level folder
- APPEND message to subfolder of NoSelect folder
- APPEND message to subfolder of dual-use folder
- APPEND message to NoSelect folder (Note: UI may not allow attempting this) => Appropriate error message.
- APPEND large message (5MB) to a folder.
- APPEND message to folder from another server
- Stress Test:
- APPEND message to folder 20 levels deep.
-
NOOP
- 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.
-
CHECK
- 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
- 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.
-
EXPUNGE
- 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. - 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.
- 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)
- Expunge a folder while another client has a connection to it => Successful expunge. Other client should notice on next NOOP, CHECK, or biff (FETCH)
- Empty trash should expunge trash folder (Note: Only relevant for trash delete model) => Successful expunge
- Empty trash while trash folder is selected => Successful expunge
- Expunge automatically; threshold-triggered
-
COPY
- COPY message from one top-level folder to another (Note: Ensure that flags, time, date are preserved) => Successful copy
- COPY message into a subfolder of the source folder
- COPY message into the parent folder of the source folder
- Stress Test:
- COPY message into a folder 20 levels deep
- COPY message into each of the special folders (inbox, trash, sent, templates, drafts)
- COPY message from one IMAP server to another
- COPY message to nonexistent folder (Note: Delete the folder with another client attached to the account) => Appropriate error message.
- COPY large message (5MB) from one folder to another
-
SUBSCRIBE
- 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)
- Try to subscribe to a NoSelect folder => Should not be possible
- Subscribe to a subfolder when the parent folder is subscribed
- Subscribe to a subfolder when the parent folder is not subscribed
- Subscribe to a folder three levels down when all parent folders are not subscribed
- Subscribe to a folder when subscription is turned off (Note: This may or may not be possible)
- Subscribe to a folder (when subscription is turned off) and the folder is currently selected
- Subscribe to a empty folder
- Subscribe to a folder with 10k messages
- Stress Test:
- Subscribe to a folder twenty levels deep
-
UNSUBSCRIBE
- Unsubscribe from a top-level folder that is currently subscribed
- Try to unsubscribe from a NoSelect folder => Shouldn't be possible
- Unsubscribe from a subfolder when the parent folder is subscribed
- Unsubscribe from a subfolder when the parent folder is not subscribed
- Unsubscribe from a folder three levels down when all parent folders are not subscribed
- Unsubscribe froma folder when subscription is turned off
- Unsubscribe from a folder when the folder is currently selected
- Unsubscribe from an empty folder
- Unsubscribe from a folder with 10k messages
- Unsubscribe froma folder twenty levels deep
-
SEARCH
- SEARCH one folder (Note: Many of these test cases will be influenced by the formation of the UI)
- SEARCH multiple folders (in a hierarchy)
- SEARCH a NoSelect folder => Shouldn't be possible
- SEARCH an unsubscribed folder (Note: May need to have subscription turned off to do this)
- SEARCH for non-ascii characters
- SEARCH a folder with 10k messages
- Stress Test:
- SEARCH a folder twenty levels deep
-
LOGOUT
- 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 - 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
- tintin:S-Trash:NET:WR: xxxx logout
- 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:
Additional Special Tests
- 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
- Upgrade to mail5 with an account that had been used with a client that does not support subscription, such as 4.0x. => TBD
- Stop actions while they're being performed. => Mail should work fine, new summary files generated.
- Delete local summary files and start mail. => Mail should work fine, new summary files generated.
- Use mail5 in a perfectly clean setup...no local mailfiles, brand new server account. => Mail should work fine.
- Send and receive unusual-content mail.
- (Note: Include vcards, signed & encrypted mails, and mails with different attachment types.) => Mail should work fine.