Ensure that the account contains a @ (#923, #924)

* Ensure that the provided username actually contains a domain
* Update README.md to be consistent with addmailuser script
* Add a test to check if the username includes the domain
This commit is contained in:
Pierre-Yves Rofes 2018-04-04 18:59:28 +02:00 committed by Johan Smits
parent 7015d09404
commit 137d623171
3 changed files with 7 additions and 1 deletions

View file

@ -1050,6 +1050,11 @@ load 'test_helper/bats-assert/load'
#
# accounts
#
@test "checking accounts: user_without_domain creation should be rejected since user@domain format is required" {
run docker exec mail /bin/sh -c "addmailuser user_without_domain mypassword"
assert_failure
assert_output --partial "username must include the domain"
}
@test "checking accounts: user3 should have been added to /tmp/docker-mailserver/postfix-accounts.cf" {
docker exec mail /bin/sh -c "addmailuser user3@domain.tld mypassword"