Integration of Exchange Server and UNIX mail service +-----+ +-----+ | | | | | | | | 172.16.0.20 | | | | ------------+- | 192.168.0.5 192.168.0.3 | | | -+----------------------------------------+-- | +-----+ +-----+ OS: UNIX (Linux, FreeBSD) Windows NT4 server Software: - firewall (kernel rules) - SP 6a - ucspi-tcp (http://cr.yp.to) - Microsoft DNS service - qmail (http://cr.yp.to) - Microsoft Exchange 5.5 - SP 3 for Exchange 5.5 Config: FQDN: border.domain.com FQDN: none IP 1: 172.16.0.20 - external IP: 192.168.0.3 IP 2: 192.168.0.5 /etc/resolv.conf search domain.com nameserver 192.168.0.3 nameserver 172.16.0.2 External DNS (172.16.0.2) provides: domain.com MX preference = 10, mail exchanger = border.domain.com domain.com nameserver = ns1.my-ISP.com domain.com nameserver = ns2.my-ISP.com ns1.my-ISP.com internet address = 172.16.0.2 ns2.my-ISP.com internet address = 172.16.2.2 Internal DNS (192.168.0.3) provides: domain.com MX preference = 5, mail exchanger = exchange.domain.com domain.com nameserver = exchange.domain.com exchange.domain.com internet address = 192.168.0.3 Microsoft Exchange Server 5.5 configuration: - install Internet Mail Service (IMS) (Internet Mail Connector) - Open Microsoft Exchange Administrator - File -> New Other -> Internet Mail Service ... - change properties of IMS as follow: - Routing: Reroute incoming SMTP mail Sent to Route to: domain.com inbound - Connections: Message delivery -> Forward all messages to host: 192.168.0.5 - stop and restart Microsoft Internet Mail Service Qmail configuration: border:~# cd /var/qmail/control border:/var/qmail/control# ls -laF total 8 drwxr-xr-x 2 root qmail 1024 Jan 4 12:40 ./ drwxr-xr-x 10 root qmail 1024 Dec 31 12:51 ../ -rw-r--r-- 1 root root 12 Jan 3 08:49 defaultdomain -rw-r--r-- 1 root root 38 Jan 3 08:51 locals -rw-r--r-- 1 root root 14 Dec 31 12:23 me -rw-r--r-- 1 root root 10 Dec 31 12:23 plusdomain -rw-r--r-- 1 root root 68 Jan 3 08:54 rcpthosts -rw-r--r-- 1 root root 52 Jan 4 12:40 smtpgreeting border:/var/qmail/control# cat defaultdomain domain.com border:/var/qmail/control# cat locals localhost border.domain.com gw.domain.com border:/var/qmail/control# cat me border.domain.com border:/var/qmail/control# cat rcpthosts localhost domain.com border.domain.com gw.border.com border:/var/qmail/control# cat smtpgreeting border.domain.com ... hi, did you study RFC 821 ? border:/var/qmail/control# Security issue: SMTP relay on the UNIX box: - create the relay database for ucspi tcp-server: - create /etc/tcp.smtp plain text: 192.168.0.3:allow,RELAYCLIENT="" 127.:allow,RELAYCLIENT="" - create tcp.smtp.cdb: tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp - run qmail under ucspi-tcp using "-x /etc/tcp.smtp.cdb": Insert -x /etc/tcp.smtp.cdb after tcpserver in your system boot scripts. The change will take effect at your next reboot. If you make any changes to /etc/tcp.smtp, you must run tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp again. You do not have to restart tcpserver. [1] References: [1] qmail FAQ