diff options
author | Peter <peter@smitmail.eu> | 2014-12-18 14:15:13 +0200 |
---|---|---|
committer | Peter <peter@smitmail.eu> | 2014-12-18 14:15:13 +0200 |
commit | eca42bcb4480d23c3bd0c3bda05f1f7e185053cd (patch) | |
tree | d4ec980238d1b785a240a9cd473ef432f7a1ae68 /modules/mailer | |
parent | 5ffeca35e78544f239b73c46bf82605ec9baa3fe (diff) | |
download | gitea-eca42bcb4480d23c3bd0c3bda05f1f7e185053cd.tar.gz gitea-eca42bcb4480d23c3bd0c3bda05f1f7e185053cd.zip |
Prefer CRAM-MD5 over PLAIN authentication
Diffstat (limited to 'modules/mailer')
-rw-r--r-- | modules/mailer/mailer.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index daee5d76e8..2347235909 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -113,10 +113,10 @@ func sendMail(settings *setting.Mailer, from string, recipients []string, msgCon if auth_available && len(settings.User) > 0 { var auth smtp.Auth - if strings.Contains(options, "PLAIN") { - auth = smtp.PlainAuth("", settings.User, settings.Passwd, host) - } else if strings.Contains(options, "CRAM-MD5") { + if strings.Contains(options, "CRAM-MD5") { auth = smtp.CRAMMD5Auth(settings.User, settings.Passwd) + } else if strings.Contains(options, "PLAIN") { + auth = smtp.PlainAuth("", settings.User, settings.Passwd, host) } if auth != nil { |