Deliver root mail (#952)

* Configure delivery of root's mail to postmaster
* Tests for delivery of root mail
* add missing email template
This commit is contained in:
Paul Adams 2018-04-23 19:35:33 +01:00 committed by Johan Smits
parent 39954da78e
commit ea848eb86f
6 changed files with 26 additions and 7 deletions

View file

@ -1,2 +1,4 @@
/^test[0-9][0-9]*@localhost.localdomain/ user1@localhost.localdomain
/^bounce.*@.*/ external1@otherdomain.tld
/^postmaster@/ user1@localhost.localdomain

View file

@ -0,0 +1,3 @@
Subject: Root Test Message
This is a test mail.

View file

@ -296,7 +296,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 10
assert_output 12
}
@test "checking smtp: delivers mail to existing alias" {
@ -326,10 +326,10 @@ load 'test_helper/bats-assert/load'
assert_output 1
}
@test "checking smtp: user1 should have received 6 mails" {
@test "checking smtp: user1 should have received 9 mails" {
run docker exec mail /bin/sh -c "ls -A /var/mail/localhost.localdomain/user1/new | wc -l"
assert_success
assert_output 7
assert_output 9
}
@test "checking smtp: rejects mail to unknown user" {
@ -1708,3 +1708,12 @@ load 'test_helper/bats-assert/load'
run docker exec mail_with_relays /bin/sh -c 'cat /etc/postfix/sasl_passwd | grep -e "^\[default.relay.com\]:2525\s\+smtp_user:smtp_password" | wc -l | grep 1'
assert_success
}
#
# root mail delivery
#
@test "checking that mail for root was delivered" {
run docker exec mail grep "Subject: Root Test Message" /var/mail/localhost.localdomain/user1/new/ -R
assert_success
}