Skip to content

Commit 5b2fd0f

Browse files
gwymorGiteaBot
andauthored
Drop "@" from email sender to avoid spam filters (#29109)
Commit 360b3fd (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 <[email protected]>
1 parent c1f7249 commit 5b2fd0f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

models/user/user.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,14 @@ func (u *User) GetDisplayName() string {
425425
}
426426

427427
// GetCompleteName returns the the full name and username in the form of
428-
// "Full Name (@username)" if full name is not empty, otherwise it returns
429-
// "@username".
428+
// "Full Name (username)" if full name is not empty, otherwise it returns
429+
// "username".
430430
func (u *User) GetCompleteName() string {
431431
trimmedFullName := strings.TrimSpace(u.FullName)
432432
if len(trimmedFullName) > 0 {
433-
return fmt.Sprintf("%s (@%s)", trimmedFullName, u.Name)
433+
return fmt.Sprintf("%s (%s)", trimmedFullName, u.Name)
434434
}
435-
return fmt.Sprintf("@%s", u.Name)
435+
return u.Name
436436
}
437437

438438
func gitSafeName(name string) string {

0 commit comments

Comments
 (0)