Limiting mail notifications

Is it possible to limit sent emails to avoid getting this error:

# cat /var/log/gitea/gitea.log | grep mail -A 10
2023/09/21 08:26:17 ...ces/mailer/mailer.go:378:func1() [E] [6502cca9-13] Failed to send emails [█████@█████.███]: Subject: Re: [██████████████] Issue description (#8), issue comments - gomail: could not send email 1: failed to issue MAIL command: 450 4.7.1 Error: too much mail from ██.██.██.██
	/source/services/mailer/mailer.go:378 (0x1ce2c19)
	/source/modules/queue/queue_disk_channel.go:59 (0x1c2b6a1)
	/source/modules/queue/queue_channel.go:64 (0x1c2979d)
	/source/modules/queue/workerpool.go:605 (0x1c3d0c2)
	/source/modules/queue/workerpool.go:311 (0x1c3b5c4)
	/usr/local/go/src/runtime/asm_amd64.s:1598 (0x474380)

I’ve found this possible solution - Gitea is not sending Notifications - #5 by Francewhoa, but I ain’t able to implement it through site administration. Is there some other way how to reduce mail notifications?

Thanks

In that thread, it was mentioned setting ENABLE_NOTIFY_MAIL to false (or removing it from config file, it defaults to false anyways Config Cheat Sheet | Gitea Documentation). This setting is not changeable in web interface, you must modify config file. This would stop all repository watchers from receiving activity notifications, which might help solve error.

The error is clear though - you are being rate limited by your email server because you have exceeded a time based quota. The best solution while keeping notifications going is to boost/remove your email account’s quota (you don’t mention provider, but there is likely a way to do this if you are hosting own email solution).

That is pretty much what I figured. I was trying to avoid having to switch email servers and solve it on the Gitea side. But the config options don’t really help me in this case.

What I would like to do is somehow from the site administration or the organization administration assign individual projects just to interested members. That would in my case solve the issue, because all the organization members mostly don’t need notifications from every repository just from those they are currently working on… It would also greatly reduce “spam” notifications that do not require any actions on their part.

I just haven’t found a way how to do that…

There is [admin] DEFAULT_EMAIL_NOTIFICATIONS in config file, which can be changed from default enabled to on mention only. I’m not sure that will affect existing users though and am not super familiar with what it affects.

You could write an SQL query to change existing user’s email notification setting as a one-time thing. That would probably cut down significantly on mail.