mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-22 15:27:02 +00:00
chasquid: Fail at RCPT TO time if a user does not exist
It's more convenient and in line with standard practice to fail RCPT TO if the user does not exist. This involves making the server and client aware of aliases, but it doesn't end up being very convoluted, and simplifies other code.
This commit is contained in:
@@ -431,13 +431,14 @@ func realMain(m *testing.M) int {
|
||||
s.AddAddr(smtpAddr, ModeSMTP)
|
||||
s.AddAddr(submissionAddr, ModeSubmission)
|
||||
|
||||
ars := aliases.NewResolver()
|
||||
localC := &courier.Procmail{}
|
||||
remoteC := &courier.SMTP{}
|
||||
s.InitQueue(tmpDir+"/queue", ars, localC, remoteC)
|
||||
s.InitQueue(tmpDir+"/queue", localC, remoteC)
|
||||
|
||||
udb := userdb.New("/dev/null")
|
||||
udb.AddUser("testuser", "testpasswd")
|
||||
s.aliasesR.AddAliasForTesting(
|
||||
"to@localhost", "testuser@localhost", aliases.EMAIL)
|
||||
s.AddDomain("localhost")
|
||||
s.AddUserDB("localhost", udb)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user