]> source.dussan.org Git - gitea.git/commitdiff
Fix: 504 5.5.2 <localhost>: Helo command rejected
authorGogs <gogitservice@gmail.com>
Thu, 19 Feb 2015 07:47:05 +0000 (10:47 +0300)
committerGogs <gogitservice@gmail.com>
Thu, 19 Feb 2015 07:47:05 +0000 (10:47 +0300)
modules/mailer/mailer.go

index 6a23e5d09ea1e4315548f82c25cea7b466dac8ce..57400e73fc2d404bdd743c75094d32a8a79fc4eb 100644 (file)
@@ -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 {