Skip to content

IMAP Compliance Testing

Greg Solovyev edited this page Aug 2, 2017 · 2 revisions

IMAP Compliance Testing

This page details how to run the Dovecot IMAP Compliance testing utility against the Zimbra IMAP server. Current compliance results are located at the bottom of this page.

Setup

IMAPTest depends on the Dovecot version >= 2.2 to compile. Download the latest versions of IMAPTest and Dovecot:

mkdir ~/compliance
cd ~/compliance
wget http://dovecot.org/nightly/dovecot-latest.tar.gz
wget http://dovecot.org/nightly/imaptest/imaptest-latest.tar.gz

Extract the tarballs:

tar zxf dovecot-latest.tar.gz
tar zxf imaptest-latest.tar.gz
ls *

dovecot-20170714
imaptest-20170714

The IMAPTest program also requires a mbox file to run the compliance suite. It may be retrieved from the following link:

wget http://www.dovecot.org/tmp/dovecot-crlf > ~/compliance/dovecot-crlf

Compilation

Dovecot needs to be compiled in order for IMAPTest to be able to utilize it's configuration and link libraries. IMAPTest can then be compiled and executed after Dovecot has been compiled.

Note: There is no need to make install Dovecot to run ImapTest.

Dovecot Compilation

First thing that needs to be done is to compile Dovecot.

If you are running this on Ubuntu the following pre-requisites must be installed:

  • build-essential

  • libssl-dev

    sudo apt install build-essential libssl-dev

Enter the appropriate dovecot directory.

cd dovecot-20170714  # Note: The directory name will change based on the date downloaded. 
./configure
make         # Can add -j n - where n is the processor count to speed compilation
cd ..

IMAPTest Compilation

Once Dovecot has finished compiling you will need to compile imaptest specifying the dovecot source directory as the with-dovecot argument.

cd imaptest-20170714  # Note: The directory name will change based on the date downloaded. 
./configure --with-dovecot=../dovecot-20170714
make

When compilation is finished the resulting binary will be found in:

imaptest-20170714/src/

Zimbra Server Preparation

Several configuration items need to be changed to allow the compliance test utility to successfully run against the Zimbra Collaboration Suite.

  • Enable clear text logins
  • Disable Start-TLS
  • Whitelist the IP Address of the machine executing the test

Ssh into the target server and become the zimbra user.

sudo su - zimbra

Update configuration:

zmprov mcf zimbraImapCleartextLoginEnabled TRUE
zmprov mcf zimbraReverseProxyImapStartTlsMode off
zmprov mcf zimbraHttpThrottleSafeIPs <ip address of machine running imaptest>

IMAP Server Compliance Testing

The IMAP compliance test suite is located inside the imaptest-<date>/src/tests subdirectory. Additional tests can be created if desired by adding additional files to this subdirectory or in another subdirectory.

The actual invocation of the compliance test is as follows:

cd imaptest-<date>
./src/imaptest host=imap-server port=143 [email protected] pass=test123 mbox=~/compliance/dovecot-crlf test=src/tests &> ~/compliance/compliance.txt

The previous command will place the output of the compliance test run in your home directory named compliance.txt.

The end of the file should look something like the following:

35 test groups: 0 failed, 10 skipped due to missing capabilities
base protocol: 0/340 individual commands failed
extensions: 0/60 individual commands failed

Note: The number of failed / passing tests will differ depending on the compliance of the target server.