mirror of
https://github.com/go-gitea/gitea
synced 2025-01-05 09:15:58 +01:00
Prefer CRAM-MD5 over PLAIN authentication
This commit is contained in:
parent
5ffeca35e7
commit
eca42bcb44
@ -113,10 +113,10 @@ func sendMail(settings *setting.Mailer, from string, recipients []string, msgCon
|
|||||||
if auth_available && len(settings.User) > 0 {
|
if auth_available && len(settings.User) > 0 {
|
||||||
var auth smtp.Auth
|
var auth smtp.Auth
|
||||||
|
|
||||||
if strings.Contains(options, "PLAIN") {
|
if strings.Contains(options, "CRAM-MD5") {
|
||||||
auth = smtp.PlainAuth("", settings.User, settings.Passwd, host)
|
|
||||||
} else if strings.Contains(options, "CRAM-MD5") {
|
|
||||||
auth = smtp.CRAMMD5Auth(settings.User, settings.Passwd)
|
auth = smtp.CRAMMD5Auth(settings.User, settings.Passwd)
|
||||||
|
} else if strings.Contains(options, "PLAIN") {
|
||||||
|
auth = smtp.PlainAuth("", settings.User, settings.Passwd, host)
|
||||||
}
|
}
|
||||||
|
|
||||||
if auth != nil {
|
if auth != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user