From 07177f04cdb6c882f3c441d85e07734946f61164 Mon Sep 17 00:00:00 2001 From: Thomas VIAL Date: Sun, 22 Nov 2015 01:57:52 +0100 Subject: [PATCH] Added IMAP connection integration test --- test/email-templates/test-imap.txt | 4 ++++ test/test.sh | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 test/email-templates/test-imap.txt diff --git a/test/email-templates/test-imap.txt b/test/email-templates/test-imap.txt new file mode 100644 index 00000000..90000864 --- /dev/null +++ b/test/email-templates/test-imap.txt @@ -0,0 +1,4 @@ +a1 LOGIN user1@localhost.localdomain mypassword +a3 EXAMINE INBOX +a4 FETCH 1 BODY[] +a5 LOGOUT diff --git a/test/test.sh b/test/test.sh index f823316b..8eeed27b 100644 --- a/test/test.sh +++ b/test/test.sh @@ -10,6 +10,10 @@ assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/saslauthd'" 0 assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/clamd'" 0 assert_raises "docker exec mail ps aux --forest | grep '/usr/sbin/amavisd-new'" 0 +# Testing IMAP server +assert_raises "docker exec mail nc -w 1 0.0.0.0 143 | grep '* OK' | grep 'STARTTLS' | grep 'Courier-IMAP ready'" 0 +assert_raises "docker exec mail /bin/sh -c 'nc -w 1 0.0.0.0 143 < /tmp/test/email-templates/test-imap.txt'" 0 + # Testing user creation assert "docker exec mail sasldblistusers2" "user1@localhost.localdomain: userPassword\nuser2@otherdomain.tld: userPassword" assert "docker exec mail ls -A /var/mail/localhost.localdomain/user1" "cur\nnew\ntmp"