We have a Sendmail installation serving as our email gateway. Most of the mail should get handed off to our Exchange server internally, but we want to be able to use alias files at the same time to handle selective routing of certain addresses to other hosts.

We've considered mailertables, LUSER_RELAY, smarthost, etc. But can't find something that works like we want it to.

The flow should be like this:

-> incoming mail hits MX gateway
1. Alias file consulted.
a. If the address is found in the alias file(s), send message to
specified alias address.
b. If address not found in alias file(s), relay mail to Exchange
server for delivery or further routing. Name needs to be domain.tld

Can anyone suggest good ways to handle this setup?

TIA,

TR