You've already forked docker-mailserver
mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-07 23:03:10 +02:00
setup.sh: docker_container first, then fall back to docker_image (#2134)
* docker_container first, then fall back to docker_image + test changes to support + test change to wait for smtp port to fix flakey tests since https://github.com/docker-mailserver/docker-mailserver/pull/2104 * quick fix * Update setup.sh Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> Co-authored-by: Casper <casperklein@users.noreply.github.com>
This commit is contained in:
@ -85,6 +85,20 @@ function wait_for_smtp_port_in_container() {
|
||||
wait_for_tcp_port_in_container 25 "${1}"
|
||||
}
|
||||
|
||||
# @param ${1} name of the postfix container
|
||||
function wait_for_smtp_port_in_container_to_respond() {
|
||||
local COUNT=0
|
||||
until [[ $(docker exec "${1}" timeout 10 /bin/sh -c "echo QUIT | nc localhost 25") == *"221 2.0.0 Bye"* ]]; do
|
||||
if [[ $COUNT -eq 20 ]]
|
||||
then
|
||||
echo "Unable to receive a valid response from 'nc localhost 25' within 20 seconds"
|
||||
return 1
|
||||
fi
|
||||
sleep 1
|
||||
((COUNT+=1))
|
||||
done
|
||||
}
|
||||
|
||||
# @param ${1} name of the postfix container
|
||||
function wait_for_amavis_port_in_container() {
|
||||
wait_for_tcp_port_in_container 10024 "${1}"
|
||||
|
Reference in New Issue
Block a user