diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-12-19 00:24:17 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-12-19 00:24:17 -0500 |
commit | b231b8c927d02c02466ea67742b63d2d67722bed (patch) | |
tree | dcf077adbe132941f5ee3f6039cfb5e5b0030425 /modules/mailer | |
parent | d01e7b01733b215f8adcff07518e2f89fbc6448d (diff) | |
download | gitea-b231b8c927d02c02466ea67742b63d2d67722bed.tar.gz gitea-b231b8c927d02c02466ea67742b63d2d67722bed.zip |
update locale and mirror code format
Diffstat (limited to 'modules/mailer')
-rw-r--r-- | modules/mailer/mailer.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 2347235909..211ad59cdd 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -82,35 +82,35 @@ func sendMail(settings *setting.Mailer, from string, recipients []string, msgCon ServerName: host, } - var conn net.Conn - if conn, err = net.Dial("tcp", net.JoinHostPort(host, port)); err != nil { + conn, err := net.Dial("tcp", net.JoinHostPort(host, port)) + if err != nil { return err } defer conn.Close() - connection_secure := false + isSecureConn := false // Start TLS directly if the port ends with 465 (SMTPS protocol) if strings.HasSuffix(port, "465") { conn = tls.Client(conn, tlsconfig) - connection_secure = true + isSecureConn = true } - var client *smtp.Client - if client, err = smtp.NewClient(conn, host); err != nil { + client, err := smtp.NewClient(conn, host) + if err != nil { return err } // If not using SMTPS, alway use STARTTLS if available - has_starttls, _ := client.Extension("STARTTLS") - if !connection_secure && has_starttls { + hasStartTLS, _ := client.Extension("STARTTLS") + if !isSecureConn && hasStartTLS { if err = client.StartTLS(tlsconfig); err != nil { return err } } - auth_available, options := client.Extension("AUTH") + canAuth, options := client.Extension("AUTH") - if auth_available && len(settings.User) > 0 { + if canAuth && len(settings.User) > 0 { var auth smtp.Auth if strings.Contains(options, "CRAM-MD5") { |