Check IMAP/SMTP servers on startup
Closes: https://todo.sr.ht/~sircmpwn/koushin/46
This commit is contained in:
parent
3bf17752ab
commit
3340fcd63d
1 changed files with 12 additions and 0 deletions
12
server.go
12
server.go
|
@ -127,6 +127,12 @@ func (s *Server) parseIMAPUpstream() error {
|
|||
panic("unreachable")
|
||||
}
|
||||
|
||||
c, err := s.dialIMAP()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to connect to IMAP server: %v", err)
|
||||
}
|
||||
c.Close()
|
||||
|
||||
s.e.Logger.Printf("Configured upstream IMAP server: %v", u)
|
||||
return nil
|
||||
}
|
||||
|
@ -159,6 +165,12 @@ func (s *Server) parseSMTPUpstream() error {
|
|||
panic("unreachable")
|
||||
}
|
||||
|
||||
c, err := s.dialSMTP()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to connect to SMTP server: %v", err)
|
||||
}
|
||||
c.Close()
|
||||
|
||||
s.e.Logger.Printf("Configured upstream SMTP server: %v", u)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue