From f1101388653d1a5f83e19ab9341e7c553cd161fb Mon Sep 17 00:00:00 2001 From: Gwyneth Morgan Date: Fri, 9 Feb 2024 03:28:00 +0000 Subject: [PATCH] Drop "@" from email sender to avoid spam filters 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" `). To avoid being flagged, instead send emails from `Display Name (username)`. Closes: #29107 --- models/user/user.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/user/user.go b/models/user/user.go index e5245dfbb0187..e44a6ec3b3bac 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -425,14 +425,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 fmt.Sprintf("%s", u.Name) } func gitSafeName(name string) string {