mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Merge pull request #973 from uchti/dev
Fix: 504 5.5.2 <localhost>: Helo command rejected
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user