SquirrelMail's IMAP Proxy is a caching IMAP proxy server intended for use with webmail clients that cannot maintain persistent connections to an IMAP server.
apt install imapproxy
/etc/imapproxy.conf
Обязательно нужно указать имя реального IMAP сервера:
server_hostname imap