scripts: perform additional checks when updating/adding/deletting accounts (#4033)

* normalize accounts to lowercase
* update CHANGELOG
* add test to verify bug fix works correctly
This commit is contained in:
Georg Lauterbach 2024-05-25 19:56:19 +02:00 committed by GitHub
parent 4119849284
commit b222035112
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 0 deletions

View file

@ -74,6 +74,19 @@ function teardown_file() { _default_teardown ; }
__should_add_new_user 'user3@domain.tld'
}
@test "should add new user 'USeRx@domain.tld' as 'userx@domain.tld' into 'postfix-accounts.cf' and log a warning" {
local MAIL_ACCOUNT='USeRx@domain.tld'
local NORMALIZED_MAIL_ACCOUNT='userx@domain.tld'
_run_in_container setup email add "${MAIL_ACCOUNT}" mypassword
assert_success
assert_output --partial "'USeRx@domain.tld' has uppercase letters and will be normalized to 'userx@domain.tld'"
__check_mail_account_exists "${NORMALIZED_MAIL_ACCOUNT}"
assert_success
assert_output "${NORMALIZED_MAIL_ACCOUNT}"
}
# To catch mistakes from substring matching:
@test "should add new user 'auser3@domain.tld' into 'postfix-accounts.cf'" {
__should_add_new_user 'auser3@domain.tld'