If by encryption you mean PGP etc, that's handled in roundcube I believe.
mbsync mirrors your protonmail inbox to disk, dovecot shares that mail folder through IMAP, and roundcube or some other frontend connects to dovecot.
For gmail/icloud IMAP, you can't use your regular account password, you have to create an "app password" and use that password for mbsync.
https://proton.me/support/bridge-for-linux
Excited to set this up, I had assumed it wasn't a possibility.