summaryrefslogtreecommitdiffstats
path: root/modules/mailer/mailer.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mailer/mailer.go')
-rw-r--r--modules/mailer/mailer.go10
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 {