分类: LINUX
2008-11-27 01:06:49
RHEL4+nginx+sendmail+perl+openwebmail
一.DNS配置
1.检查安装bind
#rpm -qa |grep bind
bind-utils-
bind-9.2.4-2
bind-libs-9.2.4-2
ypbind-1.17.2-3
bind-chroot-9.2.4-2
2.修改配置文件
#vi /etc/named.conf
正向
zone "test5.com" IN {
type master;
file "test5.com";
};
反向:
zone "30.168.192.in-addr.arpa" IN {
type master;
file "192.168.30.zone";
#cd /var/named/chroot/var/named
------------------------------------------------------------------
-------------------------反向配置----------------------------------
#vi 192.168.30.zone
$TTL 86400
@ IN SOA server.test5.com. root.server.test5.com. (
2008112498 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS server.test5.com.
IN MX 10 mail.test5.com.
81 IN PTR server.test5.com.
200 IN PTR winxp.test5.com.
81 IN PTR mail.test5.com.
------------------------------------------------------------------
-------------------------正向配置----------------------------------
vi test5.com
$TTL 86400
@ IN SOA server.test5.com. root.server.test5.com. (
2008112609 ; serial (d.
3H ; refresh
1W ; expiry
1D ) ; minimum
IN NS server.test5.com.
server IN A 192.168.30.81
blog IN A 192.168.30.81
bbs IN A 192.168.30.81
admin IN A 192.168.30.81
winxp IN A 192.168.30.200
www IN CNAME server.test5.com.
mail IN A 192.168.30.81
test5.com. IN MX 5 mail.test5.com.
3.检查并测试
#named-checkconf /etc/named.conf
#named-checkzone test5.com test5.com
#named-checkzone test5.com 192.168.30.zone
#service named restart
#nslookup
#> mail.test5.com
Server: 192.168.30.81
Address: 192.168.30.81#53
Name: mail.test5.com
Address: 192.168.30.81
> 192.168.30.81
Server: 192.168.30.81
Address: 192.168.30.81#53
81.30.168.192.in-addr.arpa name = server.test5.com.
81.30.168.192.in-addr.arpa name = mail.test5.com
二。sendmail配置
#rpm -qa |grep sendmail
sendmail-
sendmail-cf-8.13.1-2
3.修改sendmail配置
#vi sendmail.mc
将dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
改为DAEMON_OPTIONS(`Port=25, Name=MTA')dnl
DAEMON_OPTIONS(`Port=587, Name=MSA,M=Ea')dnl
将48,49行前的dnl去掉
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
; 确定系统的认证方式
#m4 sendmail.mc > sendmail.cf
4. 启动sendmail
# /etc/rc.d/init.d/sendmail start
5. 修改档案/etc/mail/local-host-names,添加收发邮件的主机名称
# vi /etc/mail/local-host-names
mail.test5.com
test5.com # 添加一别名,为了收取格式的信件
6. 修改档案/etc/mail/access,设定邮件服务器使用权限
# vi /etc/mail/access
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
test5.com RELAY
192.168.30 RELAY # 允许整个B网,同理可设置C网和单个IP
7. 修改档案/etc/aliases,设定使用者别名
7.1 群发功能的实现
# vi /etc/aliases //在里面加入下面行
id: id1, id2, id3……
这样发给的邮件就会复制成三份,分别发给, ,
修改后需要运行如下命令更新
#newaliases
群发功能实现的另一种方法是修改用户根目录下的.forward类似进行添加
三.配置Dovecot服务
2.检查是否安装sasl服务
#rpm -qa |grep sasl ;验证模块
cyrus-sasl-md5-
cyrus-sasl-devel-2.1.19-5.EL4
cyrus-sasl-2.1.19-5.EL4
cyrus-sasl-plain-2.1.19-5.EL4
#service saslauthd restart
2.检查是否安装dovecot服务
# rpm -qa |grep dovecot ;pop收发邮件模块
dovecot-0.99.11-2.EL4.1
3.配置dovecot
# vi /etc/dovecot.conf
protocols = imap imaps pop3 pop3s # 配置协议
# service dovecot restart
4. 可以检查一下各项服务已经运行
# netstat -ln |grep 25
tcp 0 0
# netstat -ln |grep 110
tcp 0 0 :::110 :::* LISTEN
# netstat -ln |grep 143
tcp 0 0 :::143 :::* LISTEN
5. 这样就可以通过Foxmail等客户端软件使用pop3收取邮件了
四、安装openwebmail及依赖软件
#rpm -ivh perl-Compress-Zlib-1.34-1.2.el4.rf.i386.rpm
#rpm -ivh perl-suidperl-
#rpm -ivh perl-suidperl-
#rpm -ivh perl-Text-Iconv-1.4-1.2.el4.rf.i386.rpm
#rpm -ivh --nodeps openwebmail-data-2.53-3.i386.rpm
#rpm -ivh openwebmail-2.53-3.i386.rpm
#cp /var/www/cgi-bin /var/www/data /share/htdocs -R
#/share/htdocs/cgi-bin/openwebmail/openwebmail-tool.pl --init ;初始化openwebmail