Sorry, I do not know an answer to this question. Although I see the global problem and wanted to explain its solution while there are no any answers yet.
The post office is a transport station, not a warehouse, folks!
The postman's task is to deliver the received letter to its recipient quickly, not to collect mail that is not their own. King Cyrus of Persia set up post stations for the replacement of tired horses and for overnight accommodation of couriers — not to archive private dossier and track his citizens.
I remember well when and why Google announced this groundbreaking innovation: “Do not remove read emails! Keep an unlimited trash archive in our servers forever! Search instead! All for free!”
I would prefer clean code and assets of Cyrus IMAP, further developing of modern JMAP, better support of good old UUCP, NNTP, and HTTP services (RSS, WebDAV), interaction with OpenSMTPd, multi-domain management, etc. Especially — some stand-alone WebUI or a Webmin (Usermin) module for user's remote self-service: Cyradm, Sieve, SASL management, at least to change own password.
Recently I moved MX from Google to my own server where I installed Cyrus, limited mailboxes to 1 GB and emails to 1 MB, and rather integrated Nextcloud suite (with Mail, Files, WebDAV, viewers, sharing, etc.) instead. Thunderbird is also well integrated with WebDAV, Send, Plik, Nextcloud, Owncloud, Box, Dropbox services.