The IMAP module supports RFC2221 (Login Referrals).
If the specified user name is routed to an external Internet address (handled with the SMTP module) the IMAP module returns a negative response and provides a login referral. If an IMAP client supports login referrals, it will automatically switch to the new address.
A user account j.smith has been moved from your server to the account John at the othercompany.com server. In order to reroute the user mail you have created an alias record in the Router:
<j.smith> = John@othercompany.com
Now, when this user tries to connect to his old j.smith account on your server, the server rejects the user name, but provides a login referral:
1234 NO [REFERRAL IMAP://John;AUTHemail@example.com/] account has been moved to a remote system
If the mail client supports login referrals, it will automatically try to connect to the server othercompany.com as the user John.