mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
aliases: Implement catch-all
This patch implements support for catch-all aliases, where users can add a `*: destination` alias. Mails sent to unknown users (or other aliases) will not be rejected, but sent to the indicated destination instead. Please see https://github.com/albertito/chasquid/issues/23 and https://github.com/albertito/chasquid/pull/24 for more discussion and background. Thanks to Alex Ellwein (aellwein@github) for the alternative patch and help with testing; and to ThinkChaos (ThinkChaos@github) for help with testing.
This commit is contained in:
@@ -76,6 +76,8 @@ type Server struct {
|
||||
|
||||
// NewServer returns a new empty Server.
|
||||
func NewServer() *Server {
|
||||
authr := auth.NewAuthenticator()
|
||||
aliasesR := aliases.NewResolver(authr.Exists)
|
||||
return &Server{
|
||||
addrs: map[SocketMode][]string{},
|
||||
listeners: map[SocketMode][]net.Listener{},
|
||||
@@ -83,8 +85,8 @@ func NewServer() *Server {
|
||||
connTimeout: 20 * time.Minute,
|
||||
commandTimeout: 1 * time.Minute,
|
||||
localDomains: &set.String{},
|
||||
authr: auth.NewAuthenticator(),
|
||||
aliasesR: aliases.NewResolver(),
|
||||
authr: authr,
|
||||
aliasesR: aliasesR,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user