diff options
author | Unknwon <u@gogs.io> | 2015-02-22 22:51:25 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-02-22 22:51:25 -0500 |
commit | 7ccab9cd09eca8fa60fdd519c97c259d4b521abd (patch) | |
tree | 914ea87da32fd27d889b2145f559c0fdad8c62af /modules/mailer | |
parent | 25f5a8d7986a710cef01d02725071d2de0a6b143 (diff) | |
parent | 2369881808a906f3072c935ab0575f08bd358821 (diff) | |
download | gitea-7ccab9cd09eca8fa60fdd519c97c259d4b521abd.tar.gz gitea-7ccab9cd09eca8fa60fdd519c97c259d4b521abd.zip |
Merge branch 'dev' of github.com:gogits/gogs into access
Conflicts:
gogs.go
models/models.go
models/user.go
templates/.VERSION
templates/org/home.tmpl
Diffstat (limited to 'modules/mailer')
-rw-r--r-- | modules/mailer/mailer.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go index 6a23e5d09e..fc6ec2fa86 100644 --- a/modules/mailer/mailer.go +++ b/modules/mailer/mailer.go @@ -10,6 +10,7 @@ import ( "net" "net/mail" "net/smtp" + "os" "strings" "github.com/gogits/gogs/modules/log" @@ -95,6 +96,15 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte) return err } + hostname, err := os.Hostname() + if err != nil { + return err + } + + if err = client.Hello(hostname); err != nil { + return err + } + // If not using SMTPS, alway use STARTTLS if available hasStartTLS, _ := client.Extension("STARTTLS") if !isSecureConn && hasStartTLS { |