IMAP Tester

imaptest was originally written for stress testing [http://www.dovecot.org/ Dovecot] IMAP server. Its primary testing method is still stress testing, but now it also parses the incoming IMAP replies and complains if anything looks broken.

Compiling

  1. Download and compile Dovecot v1.1 sources. imaptest uses its library functions.
    1. Get the latest beta from http://dovecot.org/releases/1.1/beta/

    2. Compiling goes the usual way: ./configure && make (there's no need for make install)

  2. Download http://www.dovecot.org/tools/imaptest.c to Dovecot sources' root directory (i.e. where the configure script exists)

  3. imaptest's header comment shows the compile command for gcc, use it or something similar.

You may want to modify the default configuration from #defines at the top of the file. This isn't required, but if you run imaptest often this way you don't have to give the same parameters every time.

Running

The most important parameters (and their defaults) are:

Other useful parameters include:

Selecting what to test:

Append mbox

When saving messages, imaptest needs to get the messages from somewhere. mbox=path parameter specifies path to a file in mbox format that's used. Messages are sequentially appended from there. Once imaptest reaches the last message, it wraps back to appending the first message.

Currently imaptest's state tracking expects that Message-IDs are unique within the mbox, otherwise it gives bogus errors. If you really want to avoid changing the Message-IDs, use no_tracking setting to disable state tracking.

You can get a test mbox file from for example http://dovecot.org/archives/dovecot.mbox. Note that it contains non-unique Message-IDs so you'll have to write some script to change those.

States

Name

Short name

Description

AUTHENTICATE

Auth

LOGIN

Logi

LIST

List

LCREATE

LCre

LDELETE

LDel

STATUS

Stat

SELECT

Sele

FETCH

Fetc

FETCH2

Fet2

SEARCH

Sear

SORT

Sort

THREAD

Thre

COPY

Copy

STORE

Stor

DELETE

Dele

EXPUNGE

Expu

APPEND

Appe

NOOP

Noop

CHECK

Chec

LOGOUT

Logo

DISCONNECT

Disc

DELAY

Dela

CHECKPOINT!

ChkP

State tracking

imaptest should catch the following errors:

Checkpointing works by letting all the pending commands finish. Then CHECK command is sent to all sessions. Once they're done, imaptest verifies that all clients' mailbox state looks exactly the same:

Common tests