summaryrefslogtreecommitdiffstats
path: root/modules/mailer
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-07-03 14:08:18 +0800
committerUnknwon <u@gogs.io>2015-07-03 14:08:18 +0800
commitc47afdff58a5327c11730f8df75cbc3f0be35a77 (patch)
tree5da674249fe9b0473d9b10c765b3e23471af68a5 /modules/mailer
parentc76ee1cf83d53d819e61a8d49a731189b32f5488 (diff)
downloadgitea-c47afdff58a5327c11730f8df75cbc3f0be35a77.tar.gz
gitea-c47afdff58a5327c11730f8df75cbc3f0be35a77.zip
add config options for HELO
Diffstat (limited to 'modules/mailer')
-rw-r--r--modules/mailer/mailer.go17
1 files changed, 11 insertions, 6 deletions
diff --git a/modules/mailer/mailer.go b/modules/mailer/mailer.go
index 74a3fca578..9dafa93f91 100644
--- a/modules/mailer/mailer.go
+++ b/modules/mailer/mailer.go
@@ -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