Solved

Using Sendmail as a mail router

Posted on 1997-02-09
1
201 Views
Last Modified: 2010-04-20
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
0
Comment
Question by:Robert011497
1 Comment
 
LVL 1

Accepted Solution

by:
mart010897 earned 100 total points
ID: 1584121
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

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question