fixup linters and smaller address errors
This commit is contained in:
parent
394eace02b
commit
09d623f2bc
|
@ -45,6 +45,8 @@ function _send_email() {
|
|||
|
||||
local TEMPLATE_FILE="/tmp/docker-mailserver-test/emails/${1:?Must provide name of template file}.txt"
|
||||
|
||||
echo "CONTAINER: ${CONTAINER_NAME} | COMMAND: swaks --server ${SERVER} --port ${PORT} --helo ${HELO} --from ${FROM} --to ${TO} ${MORE_SWAKS_OPTIONS[*]} --data - < ${TEMPLATE_FILE}" >/tmp/log
|
||||
|
||||
_run_in_container_bash "swaks --server ${SERVER} --port ${PORT} --helo ${HELO} --from ${FROM} --to ${TO} ${MORE_SWAKS_OPTIONS[*]} --data - < ${TEMPLATE_FILE}"
|
||||
}
|
||||
|
||||
|
|
|
@ -54,6 +54,6 @@ function teardown_file() { _default_teardown ; }
|
|||
}
|
||||
|
||||
@test 'rejects virus' {
|
||||
_run_in_container_bash "grep 'Blocked INFECTED' /var/log/mail/mail.log | grep '<example-user@example.test> -> <user1@localhost.localdomain>'"
|
||||
_run_in_container_bash "grep 'Blocked INFECTED' /var/log/mail/mail.log | grep '<user@external.tld> -> <user1@localhost.localdomain>'"
|
||||
assert_success
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ function setup_file() {
|
|||
assert_success
|
||||
|
||||
# Set default implicit container fallback for helpers:
|
||||
CONTAINER_NAME=${CONTAINER_NAME}
|
||||
CONTAINER_NAME=${CONTAINER1_NAME}
|
||||
}
|
||||
|
||||
function teardown_file() {
|
||||
|
@ -45,8 +45,9 @@ function teardown_file() {
|
|||
# Expected postscreen log entry:
|
||||
assert_output --partial 'Protocol error'
|
||||
|
||||
_service_log_should_contain_string 'mail' 'COMMAND PIPELINING'
|
||||
_service_log_should_contain_string 'mail' 'DATA without valid RCPT'
|
||||
_run_in_container cat /var/log/mail.log
|
||||
assert_output --partial 'COMMAND PIPELINING'
|
||||
assert_output --partial 'DATA without valid RCPT'
|
||||
}
|
||||
|
||||
@test "should successfully pass postscreen and get postfix greeting message (respecting postscreen_greet_wait time)" {
|
||||
|
@ -59,5 +60,6 @@ function teardown_file() {
|
|||
# _print_mail_log_for_id "${MAIL_ID}"
|
||||
# assert_output --partial "stored mail into mailbox 'INBOX'"
|
||||
|
||||
_service_log_should_contain_string 'mail' 'PASS NEW'
|
||||
_run_in_container cat /var/log/mail.log
|
||||
assert_output --partial 'PASS NEW'
|
||||
}
|
||||
|
|
|
@ -236,12 +236,12 @@ function setup_file() {
|
|||
@test "rejects spam" {
|
||||
_run_in_container grep 'Blocked SPAM {NoBounceInbound,Quarantined}' /var/log/mail/mail.log
|
||||
assert_success
|
||||
assert_output --partial '<example-user@example.test> -> <user1@localhost.localdomain>'
|
||||
assert_output --partial '<user@external.tld> -> <user1@localhost.localdomain>'
|
||||
_should_output_number_of_lines 1
|
||||
|
||||
# Amavis log line with SPAMASSASSIN_SPAM_TO_INBOX=0 + grep 'Passed SPAM {RelayedTaggedInbound,Quarantined}' /var/log/mail/mail.log:
|
||||
# Amavis log line with SPAMASSASSIN_SPAM_TO_INBOX=1 + grep 'Blocked SPAM {NoBounceInbound,Quarantined}' /var/log/mail/mail.log:
|
||||
# <example-user@example.test> -> <user1@localhost.localdomain>
|
||||
# <user@external.tld> -> <user1@localhost.localdomain>
|
||||
# Amavis log line with ENABLE_SRS=1 changes the domain-part to match in a log:
|
||||
# <SRS0=g+ca=5C=external.tld=spam@example.test> -> <user1@localhost.localdomain>
|
||||
# assert_output --partial 'external.tld=spam@example.test> -> <user1@localhost.localdomain>'
|
||||
|
|
Loading…
Reference in New Issue