diff --git a/mail.go b/mail.go index 785d986..d237a43 100644 --- a/mail.go +++ b/mail.go @@ -2,6 +2,7 @@ package main import ( "os" + "time" mail "gopkg.in/mail.v2" ) @@ -33,6 +34,7 @@ func deliverMessage(s *ServerConfig, m *mail.Message) error { if s.Encryption { dialer.StartTLSPolicy = mail.MandatoryStartTLS } + dialer.Timeout = 30 * time.Second return dialer.DialAndSend(m) }