mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
add support for email timeouts
This commit is contained in:
parent
46572b871f
commit
032ca175e4
4 changed files with 29 additions and 6 deletions
|
|
@ -9,6 +9,7 @@ import (
|
|||
"net"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ergochat/ergo/irc/smtp"
|
||||
)
|
||||
|
|
@ -40,6 +41,7 @@ type MailtoConfig struct {
|
|||
MTAReal MTAConfig `yaml:"mta"`
|
||||
BlacklistRegexes []string `yaml:"blacklist-regexes"`
|
||||
blacklistRegexes []*regexp.Regexp
|
||||
Timeout time.Duration
|
||||
}
|
||||
|
||||
func (config *MailtoConfig) Postprocess(heloDomain string) (err error) {
|
||||
|
|
@ -126,5 +128,5 @@ func SendMail(config MailtoConfig, recipient string, msg []byte) (err error) {
|
|||
addr = fmt.Sprintf("%s:smtp", mx)
|
||||
}
|
||||
|
||||
return smtp.SendMail(addr, auth, config.HeloDomain, config.Sender, []string{recipient}, msg, config.RequireTLS)
|
||||
return smtp.SendMail(addr, auth, config.HeloDomain, config.Sender, []string{recipient}, msg, config.RequireTLS, config.Timeout)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue