@Blort I have webmail that filters into folders. In Thunderbird, under 'Folder Properties', I have set retention policies, for example, I have a folder named '7-days'
Retention policy = Delete messages more than 7 days old.
That works for me, is that any use to you?