mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-22 15:27:02 +00:00
auth: Allow users without a domain
Some deployments already have users that authenticate without a domain. Today, we refuse to even consider those, and reject them at parsing time. However, it is a use-case worth supporting, at least with some restrictions that make the complexity manageable. This patch changes the auth package to support authenticating users without an "@domain" part. Those requests will always be directly passed on to the fallback authenticator, if available. The dovecot fallback authenticator can already handle this case just fine.
This commit is contained in:
@@ -51,11 +51,22 @@ mkdir -p .logs
|
||||
chasquid -v=2 --logfile=.logs/chasquid.log --config_dir=config &
|
||||
wait_until_ready 1025
|
||||
|
||||
# Send an email as user@srv successfully.
|
||||
# Send an email as "user@srv" successfully.
|
||||
run_msmtp user@srv < content
|
||||
wait_for_file .mail/user@srv
|
||||
mail_diff content .mail/user@srv
|
||||
|
||||
# Send an email as "naked" successfully.
|
||||
rm .mail/user@srv
|
||||
run_msmtp -a naked user@srv < content
|
||||
wait_for_file .mail/user@srv
|
||||
mail_diff content .mail/user@srv
|
||||
|
||||
# Send an email to the "naked" user successfully.
|
||||
run_msmtp naked@srv < content
|
||||
wait_for_file .mail/naked@srv
|
||||
mail_diff content .mail/naked@srv
|
||||
|
||||
# Fail to send to nobody@srv (user does not exist).
|
||||
if run_msmtp nobody@srv < content 2> /dev/null; then
|
||||
fail "successfuly sent an email to a non-existent user"
|
||||
|
||||
Reference in New Issue
Block a user