diff options
author | Gwyneth Morgan <gwymor@tilde.club> | 2024-02-10 04:40:48 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-02-11 13:47:44 +0100 |
commit | 9a1d5c549cb6d32219647ea1a771b8a82d5ac89f (patch) | |
tree | c42d7878e58527573a5ea5312245bdacc0404153 /models/user/user.go | |
parent | [gitea] [skip ci] Updated translations via Crowdin (diff) | |
download | forgejo-9a1d5c549cb6d32219647ea1a771b8a82d5ac89f.tar.xz forgejo-9a1d5c549cb6d32219647ea1a771b8a82d5ac89f.zip |
[gitea] Drop "@" from email sender to avoid spam filters (#29109)
Commit 360b3fd17c (Include username in email headers (#28981),
2024-02-03) adds usernames to the From field of notification emails in
the form of `Display Name (@username)`, to prevent spoofing. However,
some email filtering software flags "@" in the display name part of the
From field as potential spoofing, as you could set the display name part
to another email address than the one you are sending from (e.g.
`From: "apparent@email-address" <actual@email-address>`). To avoid
being flagged, instead send emails from `Display Name (username)`.
Closes: #29107
---------
Co-authored-by: Giteabot <teabot@gitea.io>
(cherry picked from commit 5b2fd0fc19a2a77414c8e2989b4794b6617221f5)
Diffstat (limited to 'models/user/user.go')
-rw-r--r-- | models/user/user.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/models/user/user.go b/models/user/user.go index 71f823dc31..0246843c9e 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -436,14 +436,14 @@ func (u *User) GetDisplayName() string { } // GetCompleteName returns the the full name and username in the form of -// "Full Name (@username)" if full name is not empty, otherwise it returns -// "@username". +// "Full Name (username)" if full name is not empty, otherwise it returns +// "username". func (u *User) GetCompleteName() string { trimmedFullName := strings.TrimSpace(u.FullName) if len(trimmedFullName) > 0 { - return fmt.Sprintf("%s (@%s)", trimmedFullName, u.Name) + return fmt.Sprintf("%s (%s)", trimmedFullName, u.Name) } - return fmt.Sprintf("@%s", u.Name) + return u.Name } func gitSafeName(name string) string { |