aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-02-20 18:25:18 -0500
committer无闻 <u@gogs.io>2015-02-20 18:25:18 -0500
commit065f8d1f561d0529a9e9d155e1aba1255f3d1168 (patch)
treeb06f39cb29b829530ccd28d02589a2c9c2626148 /modules
parent8f1d2d9f240b0ef62df13b8c90d199fcf6069b34 (diff)
parent2f1369c6147b51d0c5f82a3d236d69ac100ef8e8 (diff)
downloadgitea-065f8d1f561d0529a9e9d155e1aba1255f3d1168.tar.gz
gitea-065f8d1f561d0529a9e9d155e1aba1255f3d1168.zip
Merge pull request #973 from uchti/dev
Fix: 504 5.5.2 <localhost>: Helo command rejected
Diffstat (limited to 'modules')
-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 {