just wondering is it possible to use one imap name imap.domain.com let all clients connect to that name behind the scene point them to the right mailserver say mail01, mail02?
You can e.g. use nginx to proxy imap connections: https://www.nginx.com/resources/wiki/start/topics/examples/imapproxyexample/
Or you can use Dovecot Proxy (https://wiki2.dovecot.org/PasswordDatabase/ExtraFields/Proxy) + Dovecot Director.