summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
authorRémi Saurel <rems4e@users.noreply.github.com>2017-09-21 06:29:45 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-09-21 12:29:45 +0800
commit66bc0ac251f564491ed0a6d5d4cfa0a11af09303 (patch)
treefa07c36ff406ec748e628f64e997860a2802ee20 /modules/setting/setting.go
parent1fbfccb4fc9fc99405174b529206524179177474 (diff)
downloadgitea-66bc0ac251f564491ed0a6d5d4cfa0a11af09303.tar.gz
gitea-66bc0ac251f564491ed0a6d5d4cfa0a11af09303.zip
Fix sending mail with a non-latin display name. #2102 (#2559)
* Fix sending mail with a non-latin display name. #2102 Signed-off-by: Rémi Saurel <contact@remi-saurel.com> * Take into account the possibility that setting.MailService.From is in `name <email@address>` format. #2102 Signed-off-by: Rémi Saurel <contact@remi-saurel.com>
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 4932f51a68..f594125503 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -1287,6 +1287,7 @@ type Mailer struct {
QueueLength int
Name string
From string
+ FromName string
FromEmail string
SendAsPlainText bool
@@ -1345,6 +1346,7 @@ func newMailService() {
if err != nil {
log.Fatal(4, "Invalid mailer.FROM (%s): %v", MailService.From, err)
}
+ MailService.FromName = parsed.Name
MailService.FromEmail = parsed.Address
log.Info("Mail Service Enabled")