Emails of new comments should use [email.incoming] REPLY_TO_ADDRESS, not [mailer] FROM #13772

Open
opened 2025-11-02 10:52:45 -06:00 by GiteaMirror · 7 comments
Owner

Originally created by @bilogic on GitHub (Nov 29, 2024).

Description

  1. Issue emails are shown as being sent by [mailer] FROM= of the app.ini
  2. This results in chaos when some reply to it instead of the plus address from [email.incoming] REPLY_TO_ADDRESS
  3. I can't test on demo.gitea.com as I can't register an account
  4. As I understand it, it is safe to set the FROM and REPLY_TO of the email content as the plus address
  5. Providers like GMail will overwrite it and self hosted SMTPs will allow it when configured correctly

Gitea Version

1.22.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

self hosted using docker

Database

None

Originally created by @bilogic on GitHub (Nov 29, 2024). ### Description 1. Issue emails are shown as being sent by `[mailer] FROM=` of the `app.ini` 2. This results in chaos when some reply to it instead of the plus address from `[email.incoming] REPLY_TO_ADDRESS` 3. I can't test on demo.gitea.com as I can't register an account 4. As I understand it, it is safe to set the FROM and REPLY_TO of the email content as the plus address 5. Providers like GMail will overwrite it and self hosted SMTPs will allow it when configured correctly ### Gitea Version 1.22.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? self hosted using docker ### Database None
GiteaMirror added the type/bug label 2025-11-02 10:52:46 -06:00
Author
Owner

@hiifong commented on GitHub (Nov 30, 2024):

Regarding the fourth question, not all emails provider are support plus addressing.

@hiifong commented on GitHub (Nov 30, 2024): Regarding the fourth question, not all emails provider are support plus addressing.
Author
Owner

@hiifong commented on GitHub (Nov 30, 2024):

I can't reproduce this problem locally.

image

image

@hiifong commented on GitHub (Nov 30, 2024): I can't reproduce this problem locally. ![image](https://github.com/user-attachments/assets/7e73a3b5-965f-4784-a13f-23befb79c6cd) ![image](https://github.com/user-attachments/assets/15d2d019-01fb-429a-aa7a-8e7c661368bc)
Author
Owner

@bilogic commented on GitHub (Nov 30, 2024):

Hi, thanks for getting back

image

  1. This is the main problem: I don't want any users to know about git@ to prevent them from replying to it
  2. I would like to force them to only reply to noreply+.....@
  3. As I understand it, self-hosted SMTP can be configured to allow sending as anyone, so Gitea can set from: noreply+.....@, this is the main change I'm asking for
  4. For public providers like Google, if Gitea set from: noreply+....@gmail.com, Google will force it back to from: your-real-email@gmail.com, so it will be as per normal for them

What do you think?

@bilogic commented on GitHub (Nov 30, 2024): Hi, thanks for getting back ![image](https://github.com/user-attachments/assets/101e1554-2e92-4551-9cb9-dc9ec7eabdca) 1. This is the main problem: I don't want any users to know about `git@` to prevent them from replying to it 2. I would like to force them to only reply to `noreply+.....@` 3. As I understand it, self-hosted SMTP can be configured to allow sending as anyone, so Gitea can set `from: noreply+.....@`, this is the main change I'm asking for 4. For public providers like Google, if Gitea set `from: noreply+....@gmail.com`, Google will force it back to `from: your-real-email@gmail.com`, so it will be as per normal for them What do you think?
Author
Owner

@hiifong commented on GitHub (Nov 30, 2024):

I understand what you mean. I think we can replace From with git+{any string}@xxxx.xxx when sending emails using smtp.

@hiifong commented on GitHub (Nov 30, 2024): I understand what you mean. I think we can replace `From` with git+{any string}@xxxx.xxx when sending emails using smtp.
Author
Owner

@bilogic commented on GitHub (Nov 30, 2024):

I understand what you mean. I think we can replace From with git+{any string}@xxxx.xxx when sending emails using smtp.

It has to match whatever reply-to: was configured to in [email.incoming] REPLY_TO_ADDRESS and should apply to only emails arising from issue comments

@bilogic commented on GitHub (Nov 30, 2024): > I understand what you mean. I think we can replace `From` with git+{any string}@xxxx.xxx when sending emails using smtp. It has to match whatever `reply-to:` was configured to in `[email.incoming] REPLY_TO_ADDRESS` and should apply to only emails arising from issue comments
Author
Owner

@KazzmanK commented on GitHub (Dec 3, 2024):

Mailer may force require FROM address to match USERNAME

@KazzmanK commented on GitHub (Dec 3, 2024): Mailer may force require FROM address to match USERNAME
Author
Owner

@bilogic commented on GitHub (Dec 4, 2024):

Sure, can we make it configurable on gitea then? Those who can will show only sub address, those who can't will just have to be restricted by their mailer.

I tested with google before, they will accept the email and overwrite the from.

@bilogic commented on GitHub (Dec 4, 2024): Sure, can we make it configurable on gitea then? Those who can will show only sub address, those who can't will just have to be restricted by their mailer. I tested with google before, they will accept the email and overwrite the from.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13772