0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-01-19 00:29:08 +01:00
gitea/services/mailer
Gwyneth Morgan 360b3fd17c
Include username in email headers (#28981)
Emails from Gitea comments do not contain the username of the commenter
anywhere, only their display name, so it is not possible to verify who
made a comment from the email itself:

	From: "Alice" <email@gitea>
	X-Gitea-Sender: Alice
	X-Gitea-Recipient: Bob
	X-GitHub-Sender: Alice
	X-GitHub-Recipient: Bob

	This comment looks like it's from @alice.

The X-Gitea/X-GitHub headers also use display names, which is not very
reliable for filtering, and inconsistent with GitHub's behavior:

	X-GitHub-Sender: lunny
	X-GitHub-Recipient: gwymor

This change includes both the display name and username in the From
header, and switches the other headers from display name to username:

	From: "Alice (@fakealice)" <email@gitea>
	X-Gitea-Sender: fakealice
	X-Gitea-Recipient: bob
	X-GitHub-Sender: fakealice
	X-GitHub-Recipient: bob

	This comment looks like it's from @alice.
2024-02-03 00:41:27 +00:00
..
incoming
token
mail_comment.go
mail_issue.go Clean up template locale usage (#27856) 2023-10-31 22:11:48 +08:00
mail_release.go Rework markup link rendering (#26745) 2024-01-15 08:49:24 +00:00
mail_repo.go Clean up template locale usage (#27856) 2023-10-31 22:11:48 +08:00
mail_team_invite.go Clean up template locale usage (#27856) 2023-10-31 22:11:48 +08:00
mail_test.go Include username in email headers (#28981) 2024-02-03 00:41:27 +00:00
mail.go Include username in email headers (#28981) 2024-02-03 00:41:27 +00:00
mailer_test.go
mailer.go Clean up template locale usage (#27856) 2023-10-31 22:11:48 +08:00
main_test.go
notify.go