mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-19 19:59:13 +03:00
implement hello hostname to resolve smtp-relay issue
This commit is contained in:
parent
d2b67277e3
commit
ece1c76aec
1 changed files with 4 additions and 2 deletions
|
@ -13,6 +13,7 @@ type SmtpMail struct {
|
||||||
port int
|
port int
|
||||||
username string
|
username string
|
||||||
password string
|
password string
|
||||||
|
helloHostName string
|
||||||
authType mail.AuthType
|
authType mail.AuthType
|
||||||
encryption mail.Encryption
|
encryption mail.Encryption
|
||||||
noTLSCheck bool
|
noTLSCheck bool
|
||||||
|
@ -46,8 +47,8 @@ func encryptionType(encryptionType string) mail.Encryption {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSmtpMail(hostname string, port int, username string, password string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail {
|
func NewSmtpMail(hostname string, port int, username string, password string, helloHostName string, noTLSCheck bool, auth string, fromName, from string, encryption string) *SmtpMail {
|
||||||
ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: authType(auth), encryption: encryptionType(encryption)}
|
ans := SmtpMail{hostname: hostname, port: port, username: username, password: password, helloHostName: helloHostName, noTLSCheck: noTLSCheck, fromName: fromName, from: from, authType: authType(auth), encryption: encryptionType(encryption)}
|
||||||
return &ans
|
return &ans
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ func (o *SmtpMail) Send(toName string, to string, subject string, content string
|
||||||
server.Authentication = o.authType
|
server.Authentication = o.authType
|
||||||
server.Username = o.username
|
server.Username = o.username
|
||||||
server.Password = o.password
|
server.Password = o.password
|
||||||
|
server.Helo = o.helloHostName
|
||||||
server.Encryption = o.encryption
|
server.Encryption = o.encryption
|
||||||
server.KeepAlive = false
|
server.KeepAlive = false
|
||||||
server.ConnectTimeout = 10 * time.Second
|
server.ConnectTimeout = 10 * time.Second
|
||||||
|
|
Loading…
Add table
Reference in a new issue