Compare commits
No commits in common. "main" and "v1.1.1" have entirely different histories.
@ -69,8 +69,6 @@ func New(cfg Config) *EmailPlainAuthSender {
|
|||||||
to string
|
to string
|
||||||
name string
|
name string
|
||||||
body string
|
body string
|
||||||
|
|
||||||
retry int
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var whiteListRegs = []*regexp.Regexp{}
|
var whiteListRegs = []*regexp.Regexp{}
|
||||||
@ -100,7 +98,7 @@ func New(cfg Config) *EmailPlainAuthSender {
|
|||||||
|
|
||||||
var emailQueue = make(chan emailItem, 1024)
|
var emailQueue = make(chan emailItem, 1024)
|
||||||
var emailSendFunc = func(to string, name, body string) (err error) {
|
var emailSendFunc = func(to string, name, body string) (err error) {
|
||||||
eml := emailItem{to, name, body, 0}
|
eml := emailItem{to, name, body}
|
||||||
emailQueue <- eml
|
emailQueue <- eml
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -141,13 +139,6 @@ func New(cfg Config) *EmailPlainAuthSender {
|
|||||||
log.Infof("to[%v],from[%s]", m.To, m.From)
|
log.Infof("to[%v],from[%s]", m.To, m.From)
|
||||||
log.Infof("smtpUser[%s],smtpPass[%s],smtpAddr[%s:%s],smtpProxy[%s]",
|
log.Infof("smtpUser[%s],smtpPass[%s],smtpAddr[%s:%s],smtpProxy[%s]",
|
||||||
smtpUser, secLogPass(smtpPass), smtpAddr, smtpPort, secLogProxy(cfg.SmtpProxy))
|
smtpUser, secLogPass(smtpPass), smtpAddr, smtpPort, secLogProxy(cfg.SmtpProxy))
|
||||||
if eml.retry < 5 {
|
|
||||||
go func() {
|
|
||||||
eml.retry++
|
|
||||||
time.Sleep(time.Duration(5*eml.retry) * time.Second)
|
|
||||||
emailQueue <- eml
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Infof("success send email to [%s]", eml.to)
|
log.Infof("success send email to [%s]", eml.to)
|
||||||
|
@ -95,6 +95,7 @@ func DialWithProxy(addr string, proxyAddr string) (*Client, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("proxy.SOCKS5 error: %w", err)
|
return nil, fmt.Errorf("proxy.SOCKS5 error: %w", err)
|
||||||
}
|
}
|
||||||
|
fmt.Println("dialer=================", dialer)
|
||||||
|
|
||||||
conn, err := dialer.Dial("tcp", addr)
|
conn, err := dialer.Dial("tcp", addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user