mirror of
https://github.com/bokysan/docker-postfix.git
synced 2024-09-20 06:46:10 +08:00
b358d71454
So, according to the documentation, usernames must always include a domain for SASL. In other words. User cannot be `johhny` but `johhny@example.org`. Further info can be found on this ticket: https://github.com/bokysan/docker-postfix/issues/192 This commit will automatically append domain if one is not provided in `SMTPD_SASL_USERS`.
23 lines
540 B
Bash
23 lines
540 B
Bash
#!/usr/bin/env bats
|
|
|
|
load /code/scripts/common.sh
|
|
load /code/scripts/common-run.sh
|
|
|
|
@test "check if SMTPD_SASL_USERS works with and without domain" {
|
|
local db_file
|
|
local SMTPD_SASL_USERS="hello:world,foo@example.com:bar"
|
|
do_postconf -e 'mydomain=example.org'
|
|
postfix_setup_smtpd_sasl_auth
|
|
|
|
postfix check
|
|
|
|
[[ -f /etc/postfix/sasl/smtpd.conf ]]
|
|
[[ -f /etc/sasl2/smtpd.conf ]]
|
|
[[ -f /etc/sasldb2 ]] || [[ -f /etc/sasl2/sasldb2 ]]
|
|
|
|
sasldblistusers2 | grep -qE "^hello@example.org:"
|
|
sasldblistusers2 | grep -qE "^foo@example.com:"
|
|
|
|
}
|
|
|