Re:How does the Gmail unsubscribe button work?
by takeda on Friday May 29, 2020 @04:28PM
(#23355106)
Not exactly what you mentioned, but if you host your own mail server you can use bogofilter-milter.pl[1] when it detects that mail is a spam it rejects it with a configurable message.
[1] https://stuff.mit.edu/~jik/software/bogofilter-milter/