-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for #192: Automatically add domains to provided usernames for SASL
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: #192 This commit will automatically append domain if one is not provided in `SMTPD_SASL_USERS`.
- Loading branch information
Showing
4 changed files
with
56 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/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:" | ||
|
||
} | ||
|