2022-11-25 22:37:58 +00:00
|
|
|
load "${REPOSITORY_ROOT}/test/test_helper/common"
|
2019-11-03 09:13:21 +00:00
|
|
|
|
|
|
|
setup_file() {
|
2022-05-30 00:53:30 +00:00
|
|
|
local PRIVATE_CONFIG
|
|
|
|
PRIVATE_CONFIG=$(duplicate_config_for_container .)
|
|
|
|
|
|
|
|
docker run -d --name mail_with_mdbox_format \
|
|
|
|
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
|
|
|
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
|
|
|
-e ENABLE_CLAMAV=0 \
|
|
|
|
-e ENABLE_SPAMASSASSIN=0 \
|
|
|
|
-e DOVECOT_MAILBOX_FORMAT=mdbox \
|
|
|
|
-e PERMIT_DOCKER=host \
|
|
|
|
-h mail.my-domain.com -t "${NAME}"
|
|
|
|
|
|
|
|
wait_for_smtp_port_in_container mail_with_mdbox_format
|
2019-11-03 09:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
teardown_file() {
|
2020-11-05 12:32:42 +00:00
|
|
|
docker rm -f mail_with_mdbox_format
|
2019-11-03 09:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@test "checking dovecot mailbox format: mdbox file created" {
|
|
|
|
run docker exec mail_with_mdbox_format /bin/sh -c "nc 0.0.0.0 25 < /tmp/docker-mailserver-test/email-templates/existing-user1.txt"
|
|
|
|
assert_success
|
|
|
|
|
2020-11-05 12:32:42 +00:00
|
|
|
# shellcheck disable=SC2016
|
2019-11-03 09:13:21 +00:00
|
|
|
repeat_until_success_or_timeout 30 docker exec mail_with_mdbox_format /bin/sh -c '[ $(ls /var/mail/localhost.localdomain/user1/storage/m.1 | wc -l) -eq 1 ]'
|
|
|
|
}
|