Skip to content

Commit 9a1d5c5

Browse files
gwymorGiteaBot
authored andcommitted
[gitea] Drop "@" from email sender to avoid spam filters (go-gitea#29109)
Commit 360b3fd (Include username in email headers (go-gitea#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: go-gitea#29107 --------- Co-authored-by: Giteabot <[email protected]> (cherry picked from commit 5b2fd0f)
1 parent 22fd29d commit 9a1d5c5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

models/user/user.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,14 @@ func (u *User) GetDisplayName() string {
436436
}
437437

438438
// GetCompleteName returns the the full name and username in the form of
439-
// "Full Name (@username)" if full name is not empty, otherwise it returns
440-
// "@username".
439+
// "Full Name (username)" if full name is not empty, otherwise it returns
440+
// "username".
441441
func (u *User) GetCompleteName() string {
442442
trimmedFullName := strings.TrimSpace(u.FullName)
443443
if len(trimmedFullName) > 0 {
444-
return fmt.Sprintf("%s (@%s)", trimmedFullName, u.Name)
444+
return fmt.Sprintf("%s (%s)", trimmedFullName, u.Name)
445445
}
446-
return fmt.Sprintf("@%s", u.Name)
446+
return u.Name
447447
}
448448

449449
func gitSafeName(name string) string {

0 commit comments

Comments
 (0)