I should elaborate.
The mailbox ID and message UID (a number) form a natural complex primary
key. If two separated masters write to the database, then they will either
have a problem merging because of conflicting primary keys, or the clients
will have a cache accuracy problem. However, I know a way around it, with
probably even very good performance.
At rejoin time, each mailbox has to be considerd on its own. If there are
new messages on one side, fine. If there are on both but the new messages
are marked 'recent' on one side, then the 'recent' messages can be
renumbered and all is well. If there are new, non-recent messages on both
sides (this should be very rare), then IMO both sides need renumbering so
those UIDs are no longer used, and the mailbox uidvalidity needs to be
increased and current IMAP sessions terminated. That should make both
well-behaved and common IMAP clients update their caches correctly.
A few days work, not more.
Arnt