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"