Are you looking to clean up your client inbox, or the server inbox?
If your client inbox, you don’t need a plugin, on the account settings synchronization & storage, on the section disk space, select the synchronize the most recent and specify the amount days, months, years, whatever.
If you want to remove too old messages from the server, perhaps the server itself offers a way to do so…