Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sendmail with 2 domains

Status
Not open for further replies.

AccessXP

IS-IT--Management
Jan 29, 2002
132
I have sendamil running fine with one domain. Where can I find easy to use instructions on adding a second mail domain.

Thanks.
 
You don't really have to do anything special to host multiple domains with sendmail.The bad news is that there is no easy way to do it. The key to running multiple domains is in the virtusertable but first you need to add the new domain to a couple other files just as you did the original domain. First add the new domain to /etc/mail/local-host-names. Next add the new domain to /etc/mail/access:

newdomain.com RELAY

When you are done, run the following command:

makemap hash /ect/mail/access.db < /etc/mail/access

Here's the time consuming part, especially if you have a lot of users. As you probably know, all users must have an account on your system. They do NOT need a home directory or login shell. All my mail-only users share the same home dir and group. They all have /sbin/nologin for their shell. Now getting back to the virtusertable. If you haven't used it yet, it's kind of a nifty thing. The file is made up of two columns. The first column is who the mail is for, and the second column is where you want it to go. The first column can be a virtual name such as webmaster but the second column must resolve to a real address unless it's an error message. Below is an example of what it will look like:

joe@domain1.com joe
fred@domain1.com fred@hotmail.com
webmaster@domain1.com john
@domain1.com error:nouser Sorry, no such user here.

jake@domain2.com jake
webmaster@domain2.com jake
bill@domain2.com 192.168.0.20
@domain2.com error:nouser Sorry, no such user here.

Most of this should be self explanatory but you will notice that there is a catch-all for each domain. This helps to cut down on junk mail. If a specific email address is not found for that domain, an error message is returned. The other thing you may wonder about is the use of an ip. Here you are just sending the mail on to another mail server and not processing it at all..
 
RhythmAce

Thanks for taking the time to reply. I will give this a shot.

I hope to return with good news.

 
First I wanted to say Thank you for your help!
Now the only question left is, If the client uses outlook express can they use test@domain and test@domain2 in the inbox area?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top