mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 01:55:29 +02:00
tests: small adjustments (#3772)
This commit is contained in:
parent
f794f65caa
commit
3a142f9726
6 changed files with 22 additions and 23 deletions
|
@ -141,14 +141,12 @@ function _send_email_and_get_id() {
|
|||
# Get rid of ${1} so only the arguments for swaks remain
|
||||
shift 1
|
||||
|
||||
local QUEUE_ID
|
||||
# The unique ID Postfix (and other services) use may be different in length
|
||||
# on different systems (e.g. amd64 (11) vs aarch64 (10)). Hence, we use a
|
||||
# range to safely capture it.
|
||||
# on different systems. Hence, we use a range to safely capture it.
|
||||
local QUEUE_ID_REGEX='[A-Z0-9]{9,12}'
|
||||
|
||||
_wait_for_empty_mail_queue_in_container
|
||||
local OUTPUT=$(_send_email "${@}" --header "Message-Id: ${MID}")
|
||||
_send_email "${@}" --header "Message-Id: ${MID}"
|
||||
_wait_for_empty_mail_queue_in_container
|
||||
|
||||
# We store Postfix's queue ID first
|
||||
|
@ -164,3 +162,12 @@ function _send_email_and_get_id() {
|
|||
run echo "${ID_ENV_VAR_REF}"
|
||||
assert_line --regexp "^${QUEUE_ID_REGEX}\|${MID}$"
|
||||
}
|
||||
|
||||
# Send a spam e-mail by utilizing GTUBE.
|
||||
#
|
||||
# Extra arguments given to this function will be supplied by `_send_email_and_get_id` directly.
|
||||
function _send_spam() {
|
||||
_send_email_and_get_id MAIL_ID_SPAM "${@}" \
|
||||
--from 'spam@external.tld' \
|
||||
--body 'XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue