Operating System - HP-UX
1748143 Members
3632 Online
108758 Solutions
New Discussion юеВ

Re: More then 1 domain on sendmail ..

 
SOLVED
Go to solution
someone_4
Honored Contributor

More then 1 domain on sendmail ..

Good morning out there in HP land!
Here I am again with more sendmail questions.
I would like to know if sendmail can host more then 1 domain.
And how would I go about doing that?
I am using sendmail 8.9.3.

Thanks

 

 

 

 P.S.This thread has been moved from HP-UX>System Administration to HP-UX > messaging-HP Forums Moderator

23 REPLIES 23
Berlene Herren
Honored Contributor

Re: More then 1 domain on sendmail ..

You can try using domaintables..

The domaintable feature is currently not documented in sendmail.cf shipped by HP. Nevertheless, the config file has been build with the FEATURE(domaintable) and has all needed rulesets. If you want to use the domaintable you need to

Enable the mailertable lookup by removing the comment in the line following
# Domain table (adding domains)

Remove the comments in the lines belonging to the comment in ruleset 96
# look up domains in the domain table

Create an external database containing the transition information for domains, eg /etc/mail/domaintable.txt and build the database with
makemap hash /etc/mail/domaintable < /etc/mail/domaintable.txt>

A domaintable can temporarily be used when trasitioning from an old domain to a new one. The domaintable enables transitions to operate smoothly by rewriting the old domain to the new. An example input file might look as follows:
my.old.domain my.new.domain

The use of the domaintable should be limited to your own domains. The LHS of each line is a domain name or one of possibly many fully qualified hostnames and the RHS is the new domain name or one of your local hostnames. Anything in domain tables is reflected into headers as the lookup is called in ruleset 3 via ruleset 96.
There are two other database lookups introduced with sendmail 8.8:

GenericsTable to transform sender addresses.
Looks up every sender in the database if enabled. Changes the sender part of the header.
VirtUserTable for virtual domains.
This is again a hook into ruleset 0 and only reroutes delivery but does not change headers.

Berlene
http://www.mindspring.com/~bkherren/dobes/index.htm
Dave Kelly_1
Respected Contributor
Solution

Re: More then 1 domain on sendmail ..

You can configure sendmail to be more than 1 domain by editing the file

/etc/mail/sendmail.cw

This file contains a list of all the names that this machine is known by. Obviously, your DNS records will need to point both domains to this machine.

The only drawback to this method is that you can't masquerade as separate domains, i.e. if you have masquerading configured then *all* mail from this machine will have the same domain name, unless you start configuring userdb (see section 33.5 of O'Reilly). Also, you cannot have duplicate names in separate domains, i.e. john.smith@domain1.com and john.smith@domain2.com are not allowed.
someone_4
Honored Contributor

Re: More then 1 domain on sendmail ..

The reason you cannot have duplicate names in separate domains, i.e. john.smith@domain1.com and john.smith@domain2.com are not allowed.
Would that be because sendmail does not know who goes where? If we have user john.smith
and his email file under /var/mail/john.smith
sendmail knows to get that file for that user regardless of the domain is this thought right?
Would if I edit the sendmail.cw file would I have to add an entry to etc/hosts? Can more then 1 domain work of one IP address? What is the limit of domains?
Dave Kelly_1
Respected Contributor

Re: More then 1 domain on sendmail ..

I don't know the limit to the number of domains.

The reason why you can't have duplicates is because when sendmail receives a message for john.smith@domain1.com or john.smith@domain2.com, it refers to /etc/mail/sendmail.cw and finds that the machine is known as either one of those names. This means that as far it is concerned, the address must be local and so the domain is stripped off and the address just becomes john.smith.

As long as your DNS records state that the machine is known as both names, you will be OK.
Christopher Caldwell
Honored Contributor

Re: More then 1 domain on sendmail ..

For multidomain configs, we use sendmail.cw. It's reasonably scaleable-we've got well over 900 domains in our sendmail.cw table.

Don't forget to enable sendmail.cw in sendmail.cf:
# file containing names of hosts for which we receive email
Fw/etc/mail/sendmail.cw

I'm not sure it's enabled by default.

To get duplicate accounts to work
e.g.
joe@domain1.com
joe@domain2.com

use /etc/mail/virtusertable

it maps e-mail addresses to local or non-local accounts.
Don't forget to enable it in sendmail.cf:
# Virtual user table (maps incoming users)
Kvirtuser dbm /etc/mail/virtusertable

The virtusertable is a dbm style hash table. The entries are formatted like
username@domain.com localaccount
yourname@domain.com someotheraccount@aol.com

To build the dbm style database use
/usr/sbin/makemap dbm /etc/mail/virtusertable < /etc/mail/virtusertable

Buy the BAT book (sendmail by Costales w/ Allman)
it's essential.

http://www.sendmail.org
and
nntp://comp.mail.sendmail
are also extremely valuable.
someone_4
Honored Contributor

Re: More then 1 domain on sendmail ..

Is all this done with 1 IP ???
Or for 900 domains do you have 900 IPs?
Christopher Caldwell
Honored Contributor

Re: More then 1 domain on sendmail ..

re: 1 IP or many IPs

You can use one IP or many IPs. In our case, we use one IP as a mail exchanger for 900+ domains.
someone_4
Honored Contributor

Re: More then 1 domain on sendmail ..

Ok .. so what I would do is point
each domain in DNS to the same IP. And just edit my .cw file.
hmm ok ill give it a try
someone_4
Honored Contributor

Re: More then 1 domain on sendmail ..

How secure is 900 domains on 1 ip ?