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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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,
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

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.


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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

726 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