make rspamd address configurable

This commit is contained in:
Seán C McCord 2023-10-01 21:32:28 -04:00
parent 5077b2e4bf
commit ef1f530bb8
Signed by: scm
GPG key ID: 4AF67648FB0336A6

View file

@ -24,6 +24,7 @@ import (
var (
listenPort int
healthPort int
rspamAddr string
enableTLS bool
)
@ -34,6 +35,7 @@ func init() {
flag.IntVar(&listenPort, "smtp", 2525, "port on which to listen for incoming emails")
flag.IntVar(&listenPort, "smtps", 2526, "port on which to listen for incoming secure emails")
flag.IntVar(&healthPort, "health", 8080, "port on which to listen for health checks")
flag.StringVar(&rspamAddr, "rspamd", "rspam:11332", "address on which rspamd may be found")
}
func main() {
@ -90,7 +92,7 @@ func main() {
AllowedDomains: allowedDomains,
Log: log,
LMTPAddress: os.Getenv("LMTP_ADDRESS"),
RSpam: milter.NewDefaultClient("tcp", "rspamd:11334"),
RSpam: milter.NewDefaultClient("tcp", rspamAddr),
OverallLimiter: rate.NewLimiter(rate.Limit(10), 20),
}