summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorGogs <gogitservice@gmail.com>2015-02-19 10:47:05 +0300
committerGogs <gogitservice@gmail.com>2015-02-19 10:47:05 +0300
commit5293ae1221988d5cd0329d2a980612fb7e4df3a7 (patch)
tree8fee078f12dbcfb8e463a5cc3edc24a7be88c1f8 /modules
parentbe19fe48d70cd7ce3ec0d49e2b6f47f83f33ad2f (diff)
downloadgitea-5293ae1221988d5cd0329d2a980612fb7e4df3a7.tar.gz
gitea-5293ae1221988d5cd0329d2a980612fb7e4df3a7.zip
Fix: 504 5.5.2 <localhost>: Helo command rejected
Diffstat (limited to 'modules')
-rw-r--r--modules/mailer/mailer.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index 6a23e5d09e..57400e73fc 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,12 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte)
return err
}
+ hostname, err := os.Hostname()
+ if err != nil {
+ return err
+ }
+ client.Hello(hostname)
+
// If not using SMTPS, alway use STARTTLS if available
hasStartTLS, _ := client.Extension("STARTTLS")
if !isSecureConn && hasStartTLS {