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.

Integrate social media with email signatures

Is your company active on social media? Do you also use email signatures? Including social media icons in your email signature is a great way to get fans for free. Let all your email users know you’re on social media quickly and easily, in a single click.


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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
A domain user account constantly getting locked out. 25 256
Exchange 2013 - OWA Timeout 7 74
exchange 2010 server 19 53
change default ports in Postfix 1 17
Microsoft Outlook is not just an email client but it is full featured Personal Information Manager. But sometimes Outlook gets disconnected and you simply can’t access it. What steps can you perform before calling IT support? In this article we will…
MS outlook is a premier email client that enable you to send and receive the e-mails with various file formats of attachments such as document files, media file, and many others formats. There is some scenario occurs when a receiver of an e-mail mes…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In this video we show how to create an Accepted Domain 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 >> Ac…

863 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

27 Experts available now in Live!

Get 1:1 Help Now