Add a check for zero SMTP config
This commit is contained in:
parent
67eb3dbbbe
commit
3048ab5afb
3
init.go
3
init.go
|
@ -236,6 +236,9 @@ func initMessengers(m *manager.Manager) messenger.Messenger {
|
||||||
srv = append(srv, s)
|
srv = append(srv, s)
|
||||||
lo.Printf("loaded SMTP: %s (%s@%s)", s.Name, s.Username, s.Host)
|
lo.Printf("loaded SMTP: %s (%s@%s)", s.Name, s.Username, s.Host)
|
||||||
}
|
}
|
||||||
|
if len(srv) == 0 {
|
||||||
|
lo.Fatalf("no SMTP servers found in config")
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize the default e-mail messenger.
|
// Initialize the default e-mail messenger.
|
||||||
msgr, err := messenger.NewEmailer(srv...)
|
msgr, err := messenger.NewEmailer(srv...)
|
||||||
|
|
Loading…
Reference in New Issue