Link to home
Start Free TrialLog in
Avatar of beatboxx
beatboxx

asked on

Sendmail: Multiple Virtual Domains

Hi,

I successfully use sendmail 8.13 for a domain (mydomain.de) as a mail-relay to MS Exchange Servers. I want to do the same thing for a second domain (mydomain.com) so you can send mails to user.name@mydomain.de and also to user.name@mydomain.com and they will both reach the same user.name@mydomain.de 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 mydomain.com address I get the following sendmail log:

Oct 6 13:41:17 mailgate sendmail[26540]: i96BfHgl026540: <-- RCPT TO:<test.test@mydomain.com>
Oct 6 13:41:17 mailgate sendmail[26540]: i96BfHgl026540: Milter: rcpts: <test.test@mydomain.com>
Oct 6 13:41:17 mailgate sendmail[26540]: i96BfHgl026540: --- 250 2.1.5 <test.test@mydomain.com>... Recipient ok
Oct 6 13:41:18 mailgate mimedefang.pl[24309]: MDLOG,i96BfHgl026540,mail_in,,,<sender@externaltestdomain.com>,<test.test@mydomain.com>,mail test
Oct 6 13:41:18 mailgate sendmail[26544]: i96BfHgl026540: to=<test.test@mydomain.com>, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=122162, relay=mydomain.com., 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
...
@mydomain.com %1@mydomain.de
...

in sendmail.cf I have the FEATURE virtusertable (per hash) enabled

FILE relay-domains
mydomain.de
mydomain.com

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,
Kurt
Avatar of jlevie
jlevie

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

local-host-names:

mailgate.mydomain.de
mydomain.de
mailgate.mydomain.com
mydomain.com

virtusertable:

@mydomain.          %1@exchg.mydomain.de
@mydomain.com   %1@exchg.mydomain.de

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

ASKER

Hi,

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

user.name@mydomain.de and
user.name@mydomain.com

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.
Kurt
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 mydomain.com. points back to mailgate.mydomain.de
Oct  7 09:48:06 mailgate sendmail[15952]: i977m490015941: to=<user.name@mydomain.com>, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=125634, relay=mydomain.com., dsn=5.3.5, stat=Local configuration error
Oct  7 09:48:06 mailgate sendmail[15952]: i977m490015941: alias postmaster => postmaster@mydomain.de
Oct  7 09:48:06 mailgate sendmail[15952]: i977m490015941: i977m690015952: DSN: Local configuration error

How can I make sendmail switch the TO address from any.name@mydomain.com to any.name@mydomain.de???

Thx a lot,
Kurt
> 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.

The trick that can also be used is a mailertable entry

say that the exchange is accepting mydomain.de

then just add

in
access
mydomain.de RELAY

and in local-host-names you have

mydomain.com


In virtusertable you have

@mydomain.com   %1@mydomain.de

Last you have
mailertable
mydomain.de      esmtp[ipaddress of exchange]







Hi,

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
mailgate.mydomain.de
mydomain.de
mailgate.mydomain.com
mydomain.com

Plus I have the mailertable empty since the relaying of mails user.name@mydomain.de to the Exchange Server works (I guess that's because of the "MAIL_HUB" entry in sendmail.mc)

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

Kurt
ASKER CERTIFIED SOLUTION
Avatar of HalldorG
HalldorG
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You can't use:

@mydomain.com   %1@mydomain.de

in virtusertable if local-host-names includes "mydomain.de". 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 mydomain.com 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.
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,
Kurt