2009年7月15日星期三

openEMM上手記

領導希望研究一個opensource 的電子郵件營銷系統 openemm http://www.openemm.org/
上面介紹如下:

OpenEMM is a feature-rich enterprise software for professional e-mail newsletters and e-mail marketing. It offers sophisticated bounce management, link tracking, lots of statistics and a script feature to set up transaction mails (data, event and time triggered).

還沒有玩過這個東東,download下來,準備搭建一個實驗環境跑跑,有一個直觀的感覺:

1, 在虛擬機vmware2.x + centos5.2 上

2,根據系統要求,bind, sendmail(當然其他的也可以,不過這種老牌子的MTA還沒有玩過)順便一起學習了,這裡爲了快用yum方式下載的

3,基本上跟著他們的安裝文檔走,記錄一下我認為重要的:

dns配置:


[root@crim etc]# rpm -qa |grep bind
bind-chroot-9.3.4-10.P1.el5_3.1
bind-utils-9.3.4-10.P1.el5_3.1
bind-9.3.4-10.P1.el5_3.1
bind-libs-9.3.4-10.P1.el5_3.1
ypbind-1.19-11.el5
[root@crim etc]#

增加該包以後,基本上所有的配置都要在/var/named/chroot/ 下麵進行配置了. 它也將/etc/init.d/named 這個腳本文件也修改了,這裡要注意

[root@crim etc]# pwd
/var/named/chroot/etc
[root@crim etc]# rpm -qa |grep bind
bind-chroot-9.3.4-10.P1.el5_3.1
bind-utils-9.3.4-10.P1.el5_3.1
bind-9.3.4-10.P1.el5_3.1
bind-libs-9.3.4-10.P1.el5_3.1
ypbind-1.19-11.el5
[root@crim etc]#
[root@crim etc]# ls
localtime named.conf rndc.key
[root@crim etc]# pwd
/var/named/chroot/etc
[root@crim etc]# cat named.conf
options {
directory "/var/named/";
};

zone "." IN {
type hint;
file "named.root"; <---named.root google自行下載,放到這個目錄就可以,其實rpm保重也有,但是沒有使用,應該也是可以的
};

zone "0.0.127.in-addr.arpa" IN {
type master;
file "0.0.127.in-addr.arpa.zone";
};

#zone "1.16.172.in-addr.arpa" IN {
#type master;
#file "1.16.172.in-addr.arpa.zone";
#};


zone "localhost" IN {
type master;
file "localhost.zone";
};

zone "openemm.testDomain.com" IN {
type master;
file "openemm.testDomain.com";
};
[root@crim etc]#

[root@crim named]# cat localhost.zone
$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum

IN NS @
IN A 127.0.0.1
IN AAAA ::1

[root@crim named]#


[root@crim named]# cat named.local
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
[root@crim named]#

[root@crim named]# cat openemm.testDomain.com
$TTL 604800
openemm.testDomain.com. IN SOA ns1.testDomain.com. hostmaster.testDomain.com. (
;2006103010 ; serial - Many people use year+month+day+integer as a system. Never greater than 2147483647 for a 32 bit processor.
2009071310 ; serial - Many people use year+month+day+integer as a system. Never greater than 2147483647 for a 32 bit processor.
86400 ; refresh - How often secondary servers (in seconds) should check in for changes in serial number. (86400 sec = 24 hrs)
7200 ; retry - How long secondary server should wait for a retry if contact failed.
1209600 ; expire - Secondary server to purge info after this length of time.
604800 ) ; default_ttl - How long data is held in cache by remote servers.
IN A 172.16.1.176 ;XXX.XXX.XXX.XXX - Note that this is the default IP address of the domain.
; I put the web server IP address here so that domain.com points to the same servers as www.domain.com
;
; Name servers for the domain
;
IN NS ns1.testDomain.com.
;
; Mail server for domain
;
IN MX 5 mail ; - Identify "mail" as the node handling mail for the domain. Do NOT specify an IP address!
;
; Nodes in domain
;
IN A 172.16.1.176 ; - Note that this is the IP address of node1
ns1 IN A 172.16.1.176 ; XXX.XXX.XXX.XXX - Optional: For hosting your own primary name server. Note that this is the IP address of ns1
smtp IN A 172.16.1.176;- Identify the IP address for node mail.
pop3 IN A 172.16.1.176;- Identify the IP address for node mail.
mail IN A 172.16.1.176; - Identify the IP address for node mail.
host IN A 172.16.1.176; - Identify the IP address for node mail.
news IN A 172.16.1.176; - Identify the IP address for node mail.
mail IN MX 10 172.16.1.176 ; - Identify the IP address for node mail.
news IN MX 5 172.16.1.176 ; - Identify the IP address for node mail.
;
; Aliases to existing nodes in domain
;
www IN CNAME ns1 ; - Define the webserver "www" to be node1.
[root@crim named]#

然後/etc/init.d/named restart --ok就可以了


4配置 sendmail

yum sendmail相關 package


[root@crim named]# rpm -qa |grep sendmail
sendmail-8.13.8-2.el5
sendmail-cf-8.13.8-2.el5
--具體參見opememm的install document.

修改位置:

116 DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
177 INPUT_MAIL_FILTER(`bav', `S=unix:/home/openemm/var/run/bav.sock, F=T')dn l

[root@crim mail]# m4 sendmail.mc sendmail.cf

/etc/init.d/sendmail

這裡要注意一下配置


[root@crim mail]# cat access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:172.16 RELAY <--否則mail發佈出去

[root@crim mail]#

5 yum mysql

6 rpm 安裝 openemm

按照文檔內容作就可以了!



没有评论:

发表评论