mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-01-07 17:47:14 +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:
@@ -202,6 +202,14 @@ func (db *DB) RemoveUser(name string) bool {
|
||||
return present
|
||||
}
|
||||
|
||||
// HasUser returns true if the user is present, False otherwise.
|
||||
func (db *DB) HasUser(name string) bool {
|
||||
db.mu.Lock()
|
||||
_, present := db.db.Users[name]
|
||||
db.mu.Unlock()
|
||||
return present
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
// Encryption schemes
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user