I'm low key on the lookout for something like this as well, to gain independence from mail providers, and I've had a browser tab for Mail Archiver open for a few months now but never got around to trying it out. Maybe this would solve your problem?
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
- 
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon. 
- 
No spam posting. 
- 
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear. 
- 
Don't duplicate the full text of your blog or github here. Just post the link for folks to click. 
- 
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda). 
- 
No trolling. 
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!
I run this setup, mostly. For backups, I just run a BorgBackup cronjob over the Maildir and the configuration folders.
My mail client is mu4e. Advantages over a web-based mail client: I can safely encrypt my e-mail (web-based GnuPG has too many flaws) and all the e-mails are stored on my hard disk for searching and archiving.
I just did this last week. I originally tried stalwart as that seemed to be a pretty small footprint (1 docker container) and had built-in PGP support. But I couldn't get the built in acme bot to work with my dns provider, maybe you'll have better luck.
I then tried mailcow and had e-mail flowing in under an hour. Of note, there are a lot of containers if you go the docker route, some may not be necessary if you just want email. I have so far left the default containers running as I don't really care about the extra containers, it's all running on a vm w 5 GB of RAM. I'm not concerned about PGP at this point as the server hard disk is encrypted via LUKs.
I can't speak to your first 2 questions, dovecot comes with mailcow, but I didn't have to set any specific settings for it.
I port forward directly to the vm, but it's on it's own isolated VLAN. use 993 for imap instead of 143, it requires SSL if using a proper mail server.
I use thunderbird for desktop and fairmail for android. mailcow dockerized does come with it's own webclient SoGo, which didn't seem too bad if that's what you prefer.
I hope this helps!
I too looked for a way to move my imap emails out of the cloud, and after looking for years, 2 came along in a matter of months. Mail Archiver and Open Archiver. I've been using Open Archiver for about 2 months and like it. I just VPN to home (well, Pangolin), and have it as a proxied web page to search old emails.
I run mbsync/isync to keep a maildir copy of my email (hosted by someone else).
You can run it periodically with cron or systemd timers, it connects to an IMAP server, downloads all emails to a directory (in maildir format) for backup. You can also use this to migrate to another IMAP server.
If the webmail sucks, I wouldn't run my own. I would consider using Thunderbird. It is a desktop/Android application. It syncs mail to your desktop/phone, so most of the time, it's working with local storage so it's much faster than most webmails.