mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-31 16:15:04 +02:00
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:
parent
39954da78e
commit
ea848eb86f
6 changed files with 26 additions and 7 deletions
|
@ -1,2 +1,4 @@
|
|||
/^test[0-9][0-9]*@localhost.localdomain/ user1@localhost.localdomain
|
||||
/^bounce.*@.*/ external1@otherdomain.tld
|
||||
/^postmaster@/ user1@localhost.localdomain
|
||||
|
||||
|
|
3
test/email-templates/root-email.txt
Normal file
3
test/email-templates/root-email.txt
Normal file
|
@ -0,0 +1,3 @@
|
|||
Subject: Root Test Message
|
||||
|
||||
This is a test mail.
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue