mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-03 01:24:52 +02:00
Introducing global filters. (#934)
* Introducing global filters * added optional after.dovecot.sieve/before.dovecot.sieve files * added global filter test
This commit is contained in:
parent
137d623171
commit
cc7c1f8804
5 changed files with 32 additions and 15 deletions
6
test/config/before.dovecot.sieve
Normal file
6
test/config/before.dovecot.sieve
Normal file
|
@ -0,0 +1,6 @@
|
|||
require ["fileinto", "copy"];
|
||||
|
||||
if address :contains ["From"] "spam@spam.com" {
|
||||
fileinto :copy "INBOX";
|
||||
}
|
||||
|
|
@ -329,7 +329,7 @@ load 'test_helper/bats-assert/load'
|
|||
@test "checking smtp: user1 should have received 6 mails" {
|
||||
run docker exec mail /bin/sh -c "ls -A /var/mail/localhost.localdomain/user1/new | wc -l"
|
||||
assert_success
|
||||
assert_output 6
|
||||
assert_output 7
|
||||
}
|
||||
|
||||
@test "checking smtp: rejects mail to unknown user" {
|
||||
|
@ -1047,6 +1047,10 @@ load 'test_helper/bats-assert/load'
|
|||
assert_output 1
|
||||
}
|
||||
|
||||
@test "checking sieve global: user1 should have gotten a copy of his spam mail" {
|
||||
run docker exec mail /bin/sh -c "grep 'Spambot <spam@spam.com>' -R /var/mail/localhost.localdomain/user1/new/"
|
||||
assert_success
|
||||
}
|
||||
#
|
||||
# accounts
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue