Set timeout for operations

This commit is contained in:
Blallo 2020-04-28 23:44:51 +02:00
parent dc71cfdef4
commit 694c4ff93c
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F

View file

@ -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)
}