Arsip

Archive for Desember, 2009

Push mail from fetchmail to Exchange server

Desember 31, 2009 2 komentar

           

 

Note :

Exchange server /active directory already active on windows server.

in case :

Hosting web/mail :anyplace.com xxxxxx

Windows 2003 server r2 / Exchange server 2007 :
IP WAN : 202.150.xxx.xxx
IP LAN : 192.168.1.8
Domain : srv1.zxc.net

Linux Centos 5.3
IP WAN : 202.150.xxx.xxx
IP LAN : 192.168.1.1
Hostname : router.zxc.net

DNS Server in windows 2003 server (Secondary) :

Forward lookup zone
bdgmail.zxc.com –>
IN A 192.168.1.8
IN NS router.zxc.com

smtpmail.zxc.com –>
IN A 192.168.1.1
IN NS router.zxc.com

DNS Server on Linux router :

zone “srv1zxc.net” IN {
type forward;
forwarders { 192.168.1.8; };
};

zone “1.168.192.in-addr.arpa” IN {
type forward;
forwarders { 192.168.1.8; };
};

zone “bdgmail.zxc.com” IN {
type master;
file “data/bdgmail.zxc.com.zone”;
allow-transfer { 192.168.1.8; };
};

zone “bdgsmtp.zxc.com” IN {
type master;
file “data/bdgsmtp.zxc.com.zone”;
allow-transfer { 192.168.1.8; };
};

create Db zone bdmailzxc.com:  /var/named/chroot/var/named/data

@               IN SOA          router.zxc.com. admin.zxc.com. (
1214414220
3600
1800
432000
3600 )

@               IN NS           router.zxc.com.
@               IN A            192.168.1.8

Create Db zone smtpmail.zxc.com :  /var/named/chroot/var/named/data

@               IN SOA          router.zxc.com. admin.zxc.com. (
1214414220
3600
1800
432000
3600 )

@               IN NS           router.zxc.com.
@               IN A            192.168.1.1

for test, ping server windows from linux with hostname/domain also otherwise. if like this :

64 bytes from srv1.zxc.com (192.168.1.8): icmp_seq=1 ttl=128 time=0.303 ms
64 bytes from srv1.zxc.com (192.168.1.8): icmp_seq=2 ttl=128 time=0.332 ms
64 bytes from srv1.zxc.com (192.168.1.8): icmp_seq=3 ttl=128 time=0.308 ms

DNS configuration is running well. 🙂

Sendmail configuration :  (Relayhost to exchange server )

Open /etc/mail/sendmail.mc file and change the following one lines :

define(`SMART_HOST’, `srv1.zxc.com’)dnl

generate sendmail :

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

restart sendmail :

/etc/init.d/sendmail restart

Install fetchmail :

yum install fetchmail

configure fetchmail :

indra.n
poll mail.xxxxx.com

proto pop3

no dnsuser “indra.n@XXXX.com” there with password “kampret” is indra.n@uxxxx.com
here
with options rewrite mimedecode fetchall nokeep
smtphost srv1.zxc.com

setup account on exchange server

replace  mail address default with email FQDN on your hosting then set as replay :

test fetchmail :

fetchmail -v -f  /etc/fetchmailrc

see the log file :

tail -f  /var/log/maillog

Kategori:Linux, Tutorial, Windows