summaryrefslogtreecommitdiffstats
path: root/services/mailer/mail_release.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-03-23 12:34:20 +0000
committerGitHub <noreply@github.com>2022-03-23 12:34:20 +0000
commit5248232c44f3819fbb8a6cdac258740afbb94823 (patch)
tree452852e66fdbc31dcc4fd89b063103b6c038e429 /services/mailer/mail_release.go
parent3f280f89e7471a6dcdaefccc64a8d39188970e63 (diff)
downloadgitea-5248232c44f3819fbb8a6cdac258740afbb94823.tar.gz
gitea-5248232c44f3819fbb8a6cdac258740afbb94823.zip
Try to prevent autolinking of displaynames by email readers (#19169)
Unfortunately many email readers will (helpfully) detect url or url-like names and automatically create links to them, even in HTML emails. This is not ideal when usernames can have dots in them. This PR tries to prevent this behaviour by sticking ZWJ characters between dots and also set the meta tag to prevent format detection. Not every email template has been changed in this way - just the activation emails but it may be that we should be setting the above meta tag in all of our emails too. Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'services/mailer/mail_release.go')
-rw-r--r--services/mailer/mail_release.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/mailer/mail_release.go b/services/mailer/mail_release.go
index 76dceb2387..b6bddeac04 100644
--- a/services/mailer/mail_release.go
+++ b/services/mailer/mail_release.go
@@ -75,8 +75,9 @@ func mailNewRelease(ctx context.Context, lang string, tos []string, rel *models.
"Subject": subject,
"Language": locale.Language(),
// helper
- "i18n": locale,
- "Str2html": templates.Str2html,
+ "i18n": locale,
+ "Str2html": templates.Str2html,
+ "DotEscape": templates.DotEscape,
}
var mailBody bytes.Buffer