Sendmail: Multiple Virtual Domains

Posted on 2004-10-06
Last Modified: 2013-12-17

I successfully use sendmail 8.13 for a domain ( as a mail-relay to MS Exchange Servers. I want to do the same thing for a second domain ( so you can send mails to and also to and they will both reach the same mail account on the MS Exchange server.

I followed the instructions for setting up virtual domains using the virtusertable and every else needed. When trying to send a message from the internet to a address I get the following sendmail log:

Oct 6 13:41:17 mailgate sendmail[26540]: i96BfHgl026540: <-- RCPT TO:<>
Oct 6 13:41:17 mailgate sendmail[26540]: i96BfHgl026540: Milter: rcpts: <>
Oct 6 13:41:17 mailgate sendmail[26540]: i96BfHgl026540: --- 250 2.1.5 <>... Recipient ok
Oct 6 13:41:18 mailgate[24309]: MDLOG,i96BfHgl026540,mail_in,,,<>,<>,mail test
Oct 6 13:41:18 mailgate sendmail[26544]: i96BfHgl026540: to=<>, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=122162,, dsn=5.3.5, stat=Local configuration error

Mimedefang shouldn't be the problem. DNS shouldn't be, too. Sendmail first says "Recipient ok" but lateron gives the error "stat=Local configuration error"???

FILE virtusertable

in I have the FEATURE virtusertable (per hash) enabled

FILE relay-domains

To restart I use
makemap hash virtusertable.db < virtusertable
make -C /etc/mail

Then I restart sendmail and mimedefang

Any ideas?
Help is truly appreciated,
Question by:beatboxx
  • 4
  • 3
  • 2
LVL 40

Expert Comment

ID: 12240685
With virtual domains involved you need a different approach than what you were using. The file contents should be:




relay-domains and mailertable need to be empty files. And you'll have to tell your exchange server to list for mail addressed to in addition to its default of  And, obviously, the Sendmail server has to be able to resolve the hostname ( via DNS or the local hosts file.

Author Comment

ID: 12246337

is it really necessary to change settings on the exchange server? Isn't there a simple way to have sendmail send all the mails going to and

to the same e-mail address on the exchange server? The exchange server is not under my supervision and I'm looking for a simple way: sendmail should provide this virtual .com-domain and the exchange server doesn't have to know this domain.

Sorry, but I'm not a pro in this field...still any further advice is appreciated.

Author Comment

ID: 12246434
Me again,

I just wanted to provide you with the full error logs:
Oct  7 09:48:06 mailgate sendmail[15952]: i977m490015941: SYSERR(root): MX list for points back to
Oct  7 09:48:06 mailgate sendmail[15952]: i977m490015941: to=<>, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=125634,, dsn=5.3.5, stat=Local configuration error
Oct  7 09:48:06 mailgate sendmail[15952]: i977m490015941: alias postmaster =>
Oct  7 09:48:06 mailgate sendmail[15952]: i977m490015941: i977m690015952: DSN: Local configuration error

How can I make sendmail switch the TO address from to

Thx a lot,
LVL 40

Expert Comment

ID: 12251387
> is it really necessary to change settings on the exchange server?

In this case, yes. Your server isn't relaying both of the domains to the exchange server. One domain is virtual and it doesn't exist on the exchange server. So you map addresses in that virtual domain to addresses in the real domain that the exchange server knows about with virtusertable. Once you have to do that with the virtual domain you need to do likewise for the real domain.

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails


Expert Comment

ID: 12251429
The trick that can also be used is a mailertable entry

say that the exchange is accepting

then just add

access RELAY

and in local-host-names you have

In virtusertable you have

Last you have
mailertable      esmtp[ipaddress of exchange]


Author Comment

ID: 12296456

thx for the tip! But it's still not working...

My access and virtusertable files are as you recommended.

In local-host-names I have

Plus I have the mailertable empty since the relaying of mails to the Exchange Server works (I guess that's because of the "MAIL_HUB" entry in

It seems as if sendmail would not change to (settings in virtusertable). Shouldn't sendmail first make this recipient changes and then try to send it to the Exchange Server?


Accepted Solution

HalldorG earned 125 total points
ID: 12302623
You should not use the MAIL_HUB entry this is because you are sending all mail to the exchange now not just mail that should be leaving for there.

And as told you should not have in the local-host-names only in access as relay
because the hosts in local-host-names are the one that have local delivery on the sendmail host (linux mailboxes)

The trix is to have in local-host-names so that virtusertable is used rewrite the mailaddresses to and then they are forwarded according to the mailertable entry to the exchange server.

Rememberer to run make after changeing the access, mailertable or virtusertable.
Remember to restart sendmail after changing local-host-names.

You can test what happens with

/usr/lib/sendmail -bv and see to where it is sent

LVL 40

Expert Comment

ID: 12303819
You can't use:

in virtusertable if local-host-names includes "". That's a circular definition as the local-host-names file tells Sendmail that it is the mail server for the domain and the virtusertable tells Sendmail to send mail for to itself. In this case you must use a virtusertable defintion like I've described above and configure the exchange server to listen for mail addressed to the FQDN in addition to mail addressed to the domain.

Author Comment

ID: 12346215
Thx HalldorG!

sorry jlevie I wanted to split the points but didn't know how and since HalldorG provided the real answer and your comment was more like "helping myself to understand why"....I gave the points to HalldorG

Thx a lot to the both of you guys,

Featured Post

Do email signature updates give you a headache?

Do you feel like all of your time is spent managing email signatures? Too busy to visit every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

Suggested Solutions

The Microsoft Exchange server database may become damaged or corrupted due to many reasons, such as system failure. When this happens, it is usually urgent to restore the system to a stable and working state. There are different symptoms and causes …
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now