How can I forward incoming messages to a specific MTA based on the username portion of the recipient's email address? I would prefer linux-based software, but Windows would work too.
Background:
Our organization is transitioning from ISP-hosted POP3 mail to Microsoft Business Productivity Online Services (Exchange Online) and it would be nice to get coexistence working so that some users could be using the new system while other users continue to use the legacy system. As each user is migrated to the new system, their mail could be redirected to the appropriate server independent of other users and of DNS propagation.
Would this system work? Are there other migration schemes more appropriate to the scenario?
Edit 1
Our current ISP is running Postfix and Dovecot. They provide us with the ability to set up email forwarding, but only to a chosen email address. That doesn't really help us because their server will still use the MX record for delivery, which is what I want to bypass.
Postfix offers the ability to forward to different servers based on the recipient username by using transport tables. These tables can be stored as text files or in a database. For example:
Source: http://www.postfix.org/transport.5.html
Per-user transport tables could be used to enable a smooth gradual migration.
All users who are still using the legacy POP3 system can retain their SMTP settings, as long as that server is doing an MX lookup for users in the same domain. It won't work if their outgoing server is authoritative for the domain. It's possible that users on Exchange Server won't be able to send messages to users on the legacy system because messages will be delivered to the mailbox on Exchange Server.
To make this even more convenient for the sysadmin, Postfix could be integrated with a MySQL database and a web application that allows mail delivery to be toggled for batches of users.
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#some_local has some suggestions.
If you set up an internal Postfix, you can send mail to the appropriate host via transport_maps. Pulling into Exchange can be accomplished via forwarding to a domain on the new Postfix server which then redirects appropriately into Exchange.
What you're looking for is a forwarding mechanism. Chances are your ISP supplied POP system already has the foundation for this kind of thing, though it really depends on what they're using. If they have the ability to set mail rules, or use a .forward (dot-forward), or something similar, you can set those on the mailboxes you want to be on the new system.
Alternately, you can cut everything over the Exchange Online, and use Outlook/Exchange rules to forward mail to the old ISP addresses. This is pretty simple to set up. The big thing is when you move your MX records you need to swap methods; stop forwarding on the POP side and start forwarding on the Exchange side.