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:
17Halbe 2018-04-05 18:54:01 +02:00 committed by Johan Smits
parent 137d623171
commit cc7c1f8804
5 changed files with 32 additions and 15 deletions

View file

@ -0,0 +1,6 @@
require ["fileinto", "copy"];
if address :contains ["From"] "spam@spam.com" {
fileinto :copy "INBOX";
}

View file

@ -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
#