2019-08-08 19:33:55 +00:00
|
|
|
load 'test_helper/common'
|
|
|
|
|
|
|
|
function setup() {
|
2020-10-20 07:33:47 +00:00
|
|
|
local PRIVATE_CONFIG
|
|
|
|
PRIVATE_CONFIG="$(duplicate_config_for_container relay-hosts)"
|
2019-08-08 19:33:55 +00:00
|
|
|
docker run -d --name mail_with_default_relay \
|
2020-10-20 07:33:47 +00:00
|
|
|
-v "${PRIVATE_CONFIG}":/tmp/docker-mailserver \
|
2020-10-19 11:13:42 +00:00
|
|
|
-v "$(pwd)/test/test-files":/tmp/docker-mailserver-test:ro \
|
2019-08-08 19:33:55 +00:00
|
|
|
-e DEFAULT_RELAY_HOST=default.relay.host.invalid:25 \
|
|
|
|
--cap-add=SYS_PTRACE \
|
|
|
|
-e PERMIT_DOCKER=host \
|
|
|
|
-e DMS_DEBUG=0 \
|
|
|
|
-h mail.my-domain.com -t ${NAME}
|
|
|
|
wait_for_finished_setup_in_container mail_with_default_relay
|
|
|
|
}
|
|
|
|
|
|
|
|
function teardown() {
|
|
|
|
docker rm -f mail_with_default_relay
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# default relay host
|
|
|
|
#
|
|
|
|
|
|
|
|
@test "checking default relay host: default relay host is added to main.cf" {
|
2019-08-21 19:16:39 +00:00
|
|
|
run docker exec mail_with_default_relay /bin/sh -c 'grep -e "^relayhost =" /etc/postfix/main.cf'
|
|
|
|
assert_output 'relayhost = default.relay.host.invalid:25'
|
2020-10-19 11:13:42 +00:00
|
|
|
}
|