I use the same setup as @conrad82@lemmy.world described. So selfhosted mail server and manual transfer via thunderbird.
If I get you right, you already have a similar setup. Then you are asking only for a automatic solution to transfer the emails from one account to another. Right?
Haven't tried it, but what about docker-mbsync? Or maybe you can put together an image like this on your own (cron job & simple email sync/transfer client, maybe mbsync or imapsync)?
Then you could sync all folders to your local account. In your email client you can use the imap settings from local account and smtp settings from gmail. You could even host your client too.
https://www.tasteatlas.com/polpette