mail notifications for releases are send for user with deactivated e-mail #9229

Closed
opened 2025-11-02 08:32:47 -06:00 by GiteaMirror · 6 comments
Owner

Originally created by @r10r on GitHub (Jul 17, 2022).

Description

I've just upated to gitea 1.16.8 and noticed that we're still getting bounce messages for users with deactivated e-mail address. We have several bot users that we don't want to receive mail for.

@Gusted I couldn't comment on #18950, so I've created a new issue intead.
It seems that you've fixed mail notifications for inactive users but not for active users with disabled mail notification

Gitea Version

1.16.8

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?

Gitea helm chart gitea-5.0.9

Database

No response

Originally created by @r10r on GitHub (Jul 17, 2022). ### Description I've just upated to gitea 1.16.8 and noticed that we're still getting bounce messages for users with deactivated e-mail address. We have several bot users that we don't want to receive mail for. @Gusted I couldn't comment on #18950, so I've created a new issue intead. It seems that you've fixed mail notifications for **inactive** users but not for **active users with disabled mail notification** ### Gitea Version 1.16.8 ### 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? Gitea helm chart **gitea-5.0.9** ### Database _No response_
GiteaMirror added the type/bug label 2025-11-02 08:32:47 -06:00
Author
Owner

@r10r commented on GitHub (Jul 17, 2022):

A sample bot user with disabled email notifications:

Screenshot 2022-07-17 at 14 18 26
@r10r commented on GitHub (Jul 17, 2022): A sample bot user with disabled email notifications: <img width="751" alt="Screenshot 2022-07-17 at 14 18 26" src="https://user-images.githubusercontent.com/309304/179397920-9108d2bb-eea0-4aea-b703-5d2c8e7a0026.png">
Author
Owner

@Gusted commented on GitHub (Jul 18, 2022):

I wasn't the one who fixed this, please see #19131. Kindly ping @zeripath


A sample bot user with disabled email notifications:

But that user isn't active, right? So the mentioned PR would have effect.

@Gusted commented on GitHub (Jul 18, 2022): I wasn't the one who fixed this, please see #19131. Kindly ping @zeripath ---- > A sample bot user with disabled email notifications: But that user isn't active, right? So the mentioned PR would have effect.
Author
Owner

@r10r commented on GitHub (Jul 18, 2022):

You're right - I must have looked at the wrong commits.
But the fix was scheduled for 1.16.5 - so should be included in v1.16.8 ?
I've received a bounce message right now for goproxy@intern.drachenfels.de
because someone created a new release.
Maybe there is still a check missing.

@r10r commented on GitHub (Jul 18, 2022): You're right - I must have looked at the wrong commits. But the fix was scheduled for 1.16.5 - so should be included in v1.16.8 ? I've **received a bounce message** right now for goproxy@intern.drachenfels.de because **someone created a new release**. Maybe there is still a check missing.
Author
Owner

@Gusted commented on GitHub (Jul 18, 2022):

But the fix was scheduled for 1.16.5 - so should be included in v1.16.8 ?

Yup.

I've received a bounce message right now for goproxy@intern.drachenfels.de
because someone created a new release.
Maybe there is still a check missing.

I don't see any check missing. Looking at the code, the MailNewRelease function will make sure all UserIDs are mailable via GetMaileableUsersByIDs, which has checks to only include active users.

@Gusted commented on GitHub (Jul 18, 2022): > But the fix was scheduled for 1.16.5 - so should be included in v1.16.8 ? Yup. > I've **received a bounce message** right now for [goproxy@intern.drachenfels.de](mailto:goproxy@intern.drachenfels.de) > because **someone created a new release**. > Maybe there is still a check missing. I don't see any check missing. Looking at the code, the [`MailNewRelease`](https://github.com/go-gitea/gitea/blob/main/services/mailer/mail_release.go#L28) function will make sure all UserIDs are mailable via [`GetMaileableUsersByIDs`](https://github.com/go-gitea/gitea/blob/main/models/user/user.go#L1037), which [has](https://github.com/go-gitea/gitea/blob/main/models/user/user.go#L1047) [checks](https://github.com/go-gitea/gitea/blob/main/models/user/user.go#L1055) to only include active users.
Author
Owner

@r10r commented on GitHub (Jul 19, 2022):

Ok, I got it. I've misinterpreted the Activated settting in User Email Management because it can be toggled.
I thought it is for enabling/disabling the email address but it's only the status whether the user
has responded to the email activation after signup - right ?

So as an admin I have to login as the (bot) user to disable the users email notifications in Settings -> Account -> Manage Email Addresses - right ?
Screenshot 2022-07-19 at 15 42 34

@r10r commented on GitHub (Jul 19, 2022): Ok, I got it. I've misinterpreted the **Activated** settting in **User Email Management** because it can be toggled. I thought it is for enabling/disabling the email address but it's only the status whether the user has responded to the email activation after signup - right ? So as an admin I have to login as the (bot) user to disable the users email notifications in **Settings -> Account -> Manage Email Addresses** - right ? <img width="1144" alt="Screenshot 2022-07-19 at 15 42 34" src="https://user-images.githubusercontent.com/309304/179765041-69042815-d9e7-45cf-a079-42dfa2ecd8c9.png">
Author
Owner

@Gusted commented on GitHub (Jul 20, 2022):

So as an admin I have to login as the (bot) user to disable the users email notifications in Settings -> Account -> Manage Email Addresses - right ?

Yes.

@Gusted commented on GitHub (Jul 20, 2022): > So as an admin I have to login as the (bot) user to disable the users email notifications in Settings -> Account -> Manage Email Addresses - right ? Yes.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9229