Earlier quoted context omitted.
Holy cow, I will have to look into this. Thanks a ton!!
filters cannot be applied retroactively, however. be sure to write your filters before receiving anything. Especially important if you're importing your email for the first time... and insanely annoying if you want to debug such an advanced filter. as always with fastmail: It has great features... but always with a massive caveat.
It would be awesome if some day there was a "jmapfilter". I think JMAP would be really efficient for this use case.