Tweaks after understanding the existing tests better

This commit is contained in:
Arne Kepp 2017-04-15 21:01:51 +02:00
parent 5326a7087a
commit 7eb6a38fd8
4 changed files with 10 additions and 10 deletions

View File

@ -1,4 +0,0 @@
require ["copy", "envelope", "vnd.dovecot.pipe"];
if envelope :is "from" "sieve.pipe@test.localdomain" {
pipe :copy "pipe_to_tmp";
}

View File

@ -0,0 +1,4 @@
require ["copy", "vnd.dovecot.pipe"];
if header :contains "subject" "Sieve pipe test message" {
pipe :copy "pipe_to_tmp";
}

View File

@ -1,12 +1,12 @@
HELO mail.external.tld
MAIL FROM: user@external.tld
RCPT TO: user1@localhost.localdomain
RCPT TO: user2@otherdomain.tld
DATA
From: Sieve-pipe-test <sieve.pipe@test.localdomain>
To: Existing Local User <alias2@localhost.localdomain>
From: Sieve-pipe-test <sieve.pipe@external.tld>
To: Existing Local User <user2@otherdomain.tld>
Date: Sat, 22 May 2010 07:43:25 -0400
Subject: Sieve pipe test message
This is a test mail to sieve pipe.
.
QUIT
QUIT

View File

@ -271,7 +271,7 @@ load 'test_helper/bats-assert/load'
@test "checking smtp: delivers mail to existing account" {
run docker exec mail /bin/sh -c "grep 'postfix/lmtp' /var/log/mail/mail.log | grep 'status=sent' | grep ' Saved)' | wc -l"
assert_success
assert_output 7
assert_output 8
}
@test "checking smtp: delivers mail to existing alias" {
@ -771,7 +771,7 @@ load 'test_helper/bats-assert/load'
assert_failure
}
@test "checking sieve: user1 should have pipe 1 email to /tmp/" {
@test "checking sieve: user2 should have piped 1 email to /tmp/" {
run docker exec mail /bin/sh -c "ls -A /tmp/pipe-test.out | wc -l"
assert_success
assert_output 1