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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP on using Sendmail to host 2 or more domains on a single server

Status
Not open for further replies.

Tedson99

Technical User
Jun 6, 2001
46
0
0
CA
I really need your help.

This is my scenario:

I have 2 companies I wanted to host mails for. I only have 1 machine to host BOTH domains (company.com, company2.com).

Now, I already setup for company.com FULLY and tested that the mail system is work both POP and SMTP.

Now, I wanted to add yet company2.com to be hosted by this same server as well.

My current configuration is

domain name: company.com
hosts: company.com (205.150.?.?)

With this configuration, I setup a few user accounts joe, apple, jason
Currently, joe@company.com;apple@company.com;jason@company.com receive/send mails no problem on using mail client Outlook Express (for example).

Since I called this server company.com as the domain name...now can I add company2.com to host as well or do I need to rename the server's domain to be companyall.com IN WHICH I CAN host company.com and company2.com?

Please help me out! Thanks!

Regards,

Tedson99 :p
 
Set up an MX record for company2.com just as you did for company.com using the same ip and mail server name. Then configure sendmail to allow relaying for that domain or tell it that company2.com is a local domain. There are many ways to configure sendmail to handle e-mail by domain mapping or address mapping, etc. You can pick the one that's best for your situation. If you can't find a way to do what you want, you could always create recipes for procmail. To make a long story short, just do the same with sendmail as you did for company.com. Remember if you used MASQUERADE_AS(company.com) in sendmail.mc, edit it out or all mail going through your server will display that name in the header.
 
P.S. :eek:)

Some distros such as RedHat will not allow other domains to have access at the system level. You may need to add it to hosts and/or hosts.allow. If you have RH you can add "sendmail:ALL" to hosts.allow.
 
Thanks for far. But would you kindly as to tell me exactly how I can setup this relay on RH or tell company2.com as local domain?

Currently my server's domain name is company.com. Would I need to change that name otherwise because I want to host also company2.com on the same server?

I have already setup the DNS server with company2.com's MX records. The only think I need to do is actually point the company.com server to using this DNS server,

I am not good at sendmail, please help and GUIDE me through the steps on how to add company2.com to my current live server when I am already hosting company.com just fine with over 10 users accounts I setup on linuxconf. Seemed like right now, whatever user I created, it only recognizes its current domain which is company.com. I am confused as to how to:

1) Add company2.com to host on this same server just like company.com

2) how to organize company.com users from company2.com users from conflicting. Thanks and I will point my email server to that DNS server I set up first.

It doesn't matter if I use the same IP? Wouldn't I need 2 static IPs for company.com and company2.com respectively? ELse, how will I be able to distingish users from using comapany.com or company2.com? Please help me thanks greatly!

Tedson99
 
I think the best way to help you understand what I'm saying is by explaining how things work. Think of DNS as the phone company's 411. You can have as many names pointing to your phone number as you want. The phone company doesn't care who picks up the phone, only that the name you asked for has that phone number. If you get a call and your kid answers the phone, they ask for you and the kid says "dad, it's for you". The way DNS asks for a certain server is via protocols and ports. In order to answer the call, you have to be there. The same thing goes for servers. let's say a call comes into you machine using http protocol on port 80. Your http server (apache in this case) takes the call. Apache sees that you have 2 websites on this IP:port so it resolves who the call is for via name based addressing. The same applies to SMTP, FTP and so on. I'm not sure what you are asking about sendmail. If you want to have your server to be the mail server for both companies, they will have to use company.com as their server. They can have their own return address, i.e. joe@company.com and jane@company2.com. If this is what you want then I can help you. If you need to have each company use a differnt server name, you will need 2 ip addresses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top