Using Sendmail as a mail router

How do i set up sendmail (8.7) so that incoming smtp mail to a linux box will automatically be routed on to other smtp mail servers.  Using the following rules

Incoming mail  XXX@domain1.com is to be routed on to another smtp mail server (local to the network) based on  XXXX

ie  Fred@domain1.com   -> fred@mailserver1.domain1.com
    Bob@domain1.com -> Bob@mailserver2.demon1.com

Any other mail eg XXXX@anyolddomain.com is forwarded to a smarthost run by our internet provider.

Can this be achieved without a local dns server to look up the mailserver1 and mailserver2 ip addresses.  Can sendmail be told to route to a ip address

eg  fred@domain1.com  -> Fred@192.168.1.1

where 192.168.1.1 is a local mail server

Robert
Robert011497Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mart010897Commented:
Well... sendmail should at least think that it can get hosts by name.  You should minimally have entries in /etc/hosts for those mailservers that you'll be sending to.  The stuff about XXX@domain.com --> YYY@somehost.domain.com can be done using the aliases table.  BUT:  Whoever does provide the DNS service for your domain needs to have an MX record for domain.com that points at your Linux box.  So some mucking about with DNS is necessary at some point regardless.

Sendmail is fiendishly complex, and it can do just about anything; so I'm not going to go into the topic of rulesets and rewriting rules with you-- it's so complex that they wrote a book on it; O'Reilly and Associates "sendmail", you can't miss it at your local book shop, pink spine, about 350 pages, just says "sendmail"; that's the definitive guide if you're getting in to sendmail administration.

If you really want to keep it simple, have you considered using MMDF mail instead of sendmail?  That's the "deliver" package.  As far as I know you can do what you want to do using MMDF, and it's much simpler to configure.  Look at ftp://ftp.cdrom.com/pub/linux/sunsite/system/Mail/delivery/mmdf-IIb-4.3.tar.gz for the package, it comes with some docs n pointers.

Hope this helps...

Mart
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.