Set timeout for operations
This commit is contained in:
parent
dc71cfdef4
commit
694c4ff93c
1 changed files with 2 additions and 0 deletions
2
mail.go
2
mail.go
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
mail "gopkg.in/mail.v2"
|
mail "gopkg.in/mail.v2"
|
||||||
)
|
)
|
||||||
|
@ -33,6 +34,7 @@ func deliverMessage(s *ServerConfig, m *mail.Message) error {
|
||||||
if s.Encryption {
|
if s.Encryption {
|
||||||
dialer.StartTLSPolicy = mail.MandatoryStartTLS
|
dialer.StartTLSPolicy = mail.MandatoryStartTLS
|
||||||
}
|
}
|
||||||
|
dialer.Timeout = 30 * time.Second
|
||||||
return dialer.DialAndSend(m)
|
return dialer.DialAndSend(m)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue