The simple way to implement this is with the optional transport table, as mentioned by another user. The downside is that it's not self updating, and you will have to manually update this table when new users are added, or old users are deleted.
That said, here's how it basically works. You determine where the majority of mailboxes will live (linux or exchange), and set that as the default destination. Then use the tranport table to override the default for all other users.
SCENARIO 1:
Most mailboxes will reside on linux, and a smaller number of mailboxes will reside on Exchange.
Assumptions:
Domain name: question.com
Exchange IP: 192.168.1.66
Some users to forward to exchange: larry, moe, and curly.
/etc/postfix/main.cf:
mydomain = question.com
myorigin=$mydomain
mydestination = localhost localhost.$mydomain $myhostname $mydomain
transport_maps = /etc/postfix/transport
/etc/postfix/transport:
larry@question.com smtp:[192.168.1.66]
moe@question.com smtp:[192.168.1.66]
curly@question.com smtp:[192.168.1.66]
Then run:
Code:
postmap hash:/etc/postfix/tranport
and
SCENARIO 2:
Most mailboxes will reside on exchange, and a smaller number of mailboxes will reside on linux. You want to deliver Moe, Larry, and Curly locally.
/etc/postfix/main.cf:
mydomain = question.com
myorigin=$mydomain
mydestination = localhost localhost.$mydomain $myhostname
relay_domains = $mydomain
relay_transport = smtp:[192.168.1.66]
transport_maps = /etc/postfix/transport
/etc/postfix/transport:
larry@question.com local
moe@question.com local
curly@question.com local
Then run:
Code:
postmap hash:/etc/postfix/tranport
and
Either way, every time you change /etc/postfix/transport, remember to run:
Code:
postmap hash:/etc/postfix/tranport
and
Again, this has a simpler setup, with higher maintenance overhead.
The alternative is a more complicated setup, with simpler (or none) maintenance overhead. This involves compiling Postfix with ldap support, and looking up exchange users via ldap queries to your domain controller. Again, this is not a simple setup and I don't know how exactly I'd implement it, so it would take some digging ( and a lot of testing) to get it to work.
Cheers,
Pablo