mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
add config options for HELO
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -104,13 +104,18 @@ func sendMail(settings *setting.Mailer, recipients []string, msgContent []byte)
|
||||
return err
|
||||
}
|
||||
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !setting.MailService.DisableHelo {
|
||||
hostname := setting.MailService.HeloHostname
|
||||
if len(hostname) == 0 {
|
||||
hostname, err = os.Hostname()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err = client.Hello(hostname); err != nil {
|
||||
return err
|
||||
if err = client.Hello(hostname); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
// If not using SMTPS, alway use STARTTLS if available
|
||||
|
@@ -478,6 +478,8 @@ type Mailer struct {
|
||||
Host string
|
||||
From string
|
||||
User, Passwd string
|
||||
DisableHelo bool
|
||||
HeloHostname string
|
||||
SkipVerify bool
|
||||
UseCertificate bool
|
||||
CertFile, KeyFile string
|
||||
@@ -512,6 +514,8 @@ func newMailService() {
|
||||
Host: sec.Key("HOST").String(),
|
||||
User: sec.Key("USER").String(),
|
||||
Passwd: sec.Key("PASSWD").String(),
|
||||
DisableHelo: sec.Key("DISABLE_HELO").MustBool(),
|
||||
HeloHostname: sec.Key("HELO_HOSTNAME").String(),
|
||||
SkipVerify: sec.Key("SKIP_VERIFY").MustBool(),
|
||||
UseCertificate: sec.Key("USE_CERTIFICATE").MustBool(),
|
||||
CertFile: sec.Key("CERT_FILE").String(),
|
||||
|
Reference in New Issue
Block a user