Well I figured it out.
So I thought I'd share what I did to make it work.
First of all you'll need to have a few things compiled/installed to do this.
I'm also partial to Slackware but some of this will work on other Distro's.
Throughout this howto I'll be telling you how and where to make changes,
It's up to you to make backup copies of the originals before you modify them.
1.) Bind/DNS - technically a caching-only server will do.
( Personally I setup an authoritive one.)
2.) Sendmail with sasl support compiled in.
I won't go into the procedure, Siege X has done a great job of that. Here's the link:
http://www.linuxquestions.org/questi...=sendmail+sasl
3.) Dyndns account if you have a dynamic IP from your ISP.
optional) spamassassin and or clamav.
For the purpose of this mini-howto I'm going to assume you already have a working install of MS Windows server with Exchange.
This might seem quick and dirty, if you need more info let me know.
Okay lets get this show on the road.
add both domain names to /etc/mail/local-host-names
This is so Sendmail knows it's supposed to accept mail from these domains.
per my example above:
Code:
# local host names
#
myfirst.domain.com
mysecond.domain.net
Next you'll need to add some things to /etc/mail/access
#Local relaying
#
localhost RELAY
127.0.0.1 RELAY
#Relay Exchange ( outbound )
#
10.x.x.1 RELAY
#Relay Exchange ( inbound )
#
To:mysecond.domain.net RELAY
Remember to run makemap on all files you modify that have corresponding .db's.
( i.e.
Code:
makemap hash /etc/mail/access.db < /etc/mail/access
this will generate a new access.db for sendmail )
Also when you make changes to any .db files you'll need to restart sendmail,
Code:
/etc/rc.d/rc.sendmail restart
BUT, we have more to do so we'll save that for the end.
Next we are going to add some entry's to /etc/mail/virtusertable
Code:
# User addresses
#
user1@mysecond.domain.net user1@mail.mysecond.domain.net
user2@mysecond.domain.net user2@mail.mysecond.domain.net
You will need to add all users that plan on using the exchange server for mail.
"remake the .db"
for this to work you'll need to make sure sendmail has the virtusertable feature
which is default.
Code:
FEATURE(`virtusertable', `hash /etc/mail/virtusertable')dnl
Now we are done with our modifications to sendmail files.
I am assuming you added sasl support and made any other mods for using smart_host.
Let's finish up the Linux box with some mods to bind.
you will need to make zone files for each of your domains and tell bind about them.
Code:
;mysecond.domain.net
;
$TTL 259200
@ IN SOA mysecond.domain.net. hostmaster.mysecond.domain.net. (
2007062201 ; serial, date plus ID#
28800 ; Refresh
7200 ; Retry
604800 ; Expire
86400) ; Minimum
NS ns1.myfirst.domain.com.
MX 10 mail
mysecond.domain.net.com. A 10.x.x.1
mail A 10.x.x.1
mailer A 10.x.x.3
router A 10.x.x.0
this zone file is for the Exchange box, the mailer is the sendmail box.
of course use your own IP's.
You will need also a reverse lookup zone.
Code:
$TTL 259200
@ IN SOA myfirst.domain.com. hostmaster.myfirst.domain.com. (
2007062201 ; serial, date plus ID#
28800 ; Refresh
7200 ; Retry
604800 ; Expire
86400) ; Minimum
NS ns1.myfirst.domain.com.
3 PTR myfirst.domain.com.
1 PTR mysecond.domain.net.
0 PTR router.myfirst.domain.com.
naming of these files is up to you really, but here is some suggestions.
"mysecond-domain.zone"
"10-x-x.zone"
these file will go into the /var/named/caching-example directory if your using that setup
or you can put them in their own dir. if you wish just make sure you get right when you put it in /etc/named.conf
Code:
zone "x.x.10.in-addr.arpa" {
type master;
notify no;
file "10-x-x.zone";
allow-update { none; };
allow-query { any; };
};
zone "mysecond.domain.net" {
type master;
notify no;
file "mysecond-domain.zone";
allow-update { none; };
allow-query { any; };
};
include "/etc/rndc.key";
note that the first three sets on the IP are reversed for that zone.
( i.e. 123.456.78.xxx becomes 78.456.123.in-addr.arpa )
That's it.
Restart bind =
Code:
/etc/rc.d/rc.bind restart
Then restart sendmail =
Code:
/etc/rc.d/rc.sendmail restart
Let's move on to the Exchange box.
Go to your active directory users and computers.
Expand your local network and select users.
Then right click domain users and select properties.
Then select the members tab.
Double click on each user in turn and add under the E-mail addresses the new address of
Code:
user1@mail.mysecond.domain.net
finally go to your smtp virtual server
and add relay permission for the sendmail box, advanced dns options for the IP of the sendmail box, and authentication of TLS.
Your done!!!
Exchange now will send and receive through the sendmail box.
Final note:
If your running firewalls any where in the network path that email will travel you will need ports opened.
Security is for another discussion, this will make it work though.