You would need to cluster your Dovecot service. This is commonly done using a highly-available shared storage (which can be a distributed file system like GlusterFS / RedHat GFS2), see the Dovecot Wiki for details.
It also seems possible to use the dsync
mailbox replication engine for keeping your instances in sync without the need for shared storage. A design draft dealing with the details of such an implementation has been published on the Dovecot blog. Make sure to use the latest 2.2 release of DoveCot if you take this route.
The SMTP service for incoming mail would not need clustering as such - the protocol is designed for fault-tolerant implementations without a single point of failure. You simply can set up two independent Postfix instances delivering to your Dovecot cluster and provide MX records pointing to each of them.
To have users connect seamlessly to your SMTP and IMAP services during an outage, consider providing a virtual IP address using a cluster resource manager service similar to Pacemaker which would be set up to direct users to the functioning server immediately and any outages would go truly unnoticed. If you cannot spare another IPv4 address for the use as a virtual IP, just setting up your both servers' IP addresses as A records for a single label in the DNS would do the job too, but clients might notice inconsistent behavior or prolonged connection times while trying to connect to an unavailable or malfunctioning server.