mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-18 14:47:03 +00:00
Log how many things were loaded for each domain
This patch makes chasquid log how many users, aliases and DKIM keys were loaded for each domain. This makes it easier to confirm changes, and troubleshoot problems related to these per-domain configuration files.
This commit is contained in:
@@ -133,16 +133,16 @@ func (s *Server) AddDomain(d string) {
|
||||
}
|
||||
|
||||
// AddUserDB adds a userdb file as backend for the domain.
|
||||
func (s *Server) AddUserDB(domain, f string) error {
|
||||
func (s *Server) AddUserDB(domain, f string) (int, error) {
|
||||
// Load the userdb, and register it unconditionally (so reload works even
|
||||
// if there are errors right now).
|
||||
udb, err := userdb.Load(f)
|
||||
s.authr.Register(domain, auth.WrapNoErrorBackend(udb))
|
||||
return err
|
||||
return udb.Len(), err
|
||||
}
|
||||
|
||||
// AddAliasesFile adds an aliases file for the given domain.
|
||||
func (s *Server) AddAliasesFile(domain, f string) error {
|
||||
func (s *Server) AddAliasesFile(domain, f string) (int, error) {
|
||||
return s.aliasesR.AddAliasesFile(domain, f)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user