You've already forked docker-mailserver
mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-09 23:07:35 +02:00
fix: Move spam to mailbox associated to the \Junk
special-use attribute (#3925)
Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
@@ -49,9 +49,11 @@ function teardown() { _default_teardown ; }
|
||||
_should_receive_spam_at '/var/mail/localhost.localdomain/user1/new/'
|
||||
}
|
||||
|
||||
@test "(enabled + MOVE_SPAM_TO_JUNK=1) should deliver spam message into Junk folder" {
|
||||
@test "(enabled + MOVE_SPAM_TO_JUNK=1) should deliver spam message into Junk mailbox" {
|
||||
export CONTAINER_NAME=${CONTAINER3_NAME}
|
||||
|
||||
_init_with_defaults
|
||||
|
||||
local CUSTOM_SETUP_ARGUMENTS=(
|
||||
--env ENABLE_AMAVIS=1
|
||||
--env ENABLE_SPAMASSASSIN=1
|
||||
@@ -60,14 +62,17 @@ function teardown() { _default_teardown ; }
|
||||
--env MOVE_SPAM_TO_JUNK=1
|
||||
--env PERMIT_DOCKER=container
|
||||
)
|
||||
_init_with_defaults
|
||||
|
||||
# Adjust 'Junk' mailbox name to verify delivery to Junk mailbox based on special-use flag instead of mailbox's name
|
||||
mv "${TEST_TMP_CONFIG}/junk-mailbox/user-patches.sh" "${TEST_TMP_CONFIG}/"
|
||||
|
||||
_common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
||||
|
||||
_should_send_spam_message
|
||||
_should_be_received_by_amavis 'Passed SPAM {RelayedTaggedInbound,Quarantined}'
|
||||
|
||||
# Should move delivered spam to Junk folder
|
||||
_should_receive_spam_at '/var/mail/localhost.localdomain/user1/.Junk/new/'
|
||||
# Should move delivered spam to the Junk mailbox (adjusted to be located at '.Spam/')
|
||||
_should_receive_spam_at '/var/mail/localhost.localdomain/user1/.Spam/new/'
|
||||
}
|
||||
|
||||
# NOTE: Same as test for `CONTAINER3_NAME`, only differing by ENV `MARK_SPAM_AS_READ=1` + `_should_receive_spam_at` location
|
||||
|
Reference in New Issue
Block a user