Most probably SpamThrottle:
https://forum.nostalrius.org/viewtopic.php?f=32&t=5350and you can
maybe "abuse" WorldFilter:
https://forum.nostalrius.org/viewtopic.php?f=63&t=22429 to do the same, but you
need to know Lua regex.
The idea being for the second addon that as it's by default a whitelist (only what matches passes, while everything else is filtered) you would have to reverse the regex itself.
So the regex you use must say "Let everything pass (whitelist) that isn't spam" instead of "blacklist anything that is spam".
Edit: to add that the 2nd suggestion is more interesting as a thought experiment than anything of practical use as reversing regex gets very complex very fast.
TL;DR Try SpamThrottle and / or request features added to it if the author is willing.