How about adding a flag to the emails that are processed? It's fairly well supported.
I needed this when i was working on my engineering project, and added 'processed' flags for already processed items. This way i could query all unprocessed items with "UNSEEN UNKEYWORD <flag>".
[1] https://feeblenerd.blogspot.com/2015/11/pretty-i3-with-xfce....