Sendmail电子邮件系统的简单架设
2007-05-31 by kenthy#qingdaonews.com
#########################################################################################
系统环境: RHEL4 [ 2.6.9-5.EL ]
主要软件版本:
sendmail-8.13.1-2
dovecot-0.99.11-2.EL4.1
squirrelmail-1.4.3a-7.EL4
m4-1.4.1-16
bind-9.2.4-2
httpd-2.0.52-9.ent
php-4.3.9-3.1
MailServer:@redhat.com 172.17.17.1/24
#########################################################################################
一、软件安装
为简化实验过程,直接使用RHEL4光盘上自带的rpm包安装各软件程序,过程略
二、配置网络参数
1> # vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=172.17.17.1
NETMASK=255.255.255.0
BROADCAST=172.17.17.255
2> # vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=redhat.com
3> # vi /etc/hosts
127.0.0.1 localhost.localdomain localhost
172.17.17.1 redhat.com mail.redhat.com rhel.net mail.rhel.net mail
4> # vi /etc/resolv.conf
nameserver 172.17.17.1
nameserver 202.106.0.20
nameserver 202.106.46.151
5> # service network restart
三、配置DNS服务器
1> # vi /var/named/chroot/etc/named.conf
options {
directory "/var/named";
forwarders { 202.106.0.20; 202.106.46.151; };
};
zone "redhat.com" IN {
type master;
file "redhat.com.zone";
};
zone "rhel.net" IN {
type master;
file "rhel.net.zone";
};
zone "17.17.172.in-addr.arpa" IN {
type master;
file "172.17.17.arpa";
};
2> # vi /var/named/chroot/var/named/redhat.com.zone //rhel.net.zone类似
$TTL 86400
@ SOA redhat.com. root.redhat.com. (
2007053001
3H
15M
1W
1200
)
IN NS mail.redhat.com.
IN MX 10 mail.redhat.com.
mail IN A 172.17.17.1
www IN CNAME mail
3> # vi /var/named/chroot/var/named/172.17.17.arpa
$TTL 86400
@ SOA redhat.com. root.redhat.com. (
2007053001
3H
15M
1W
1200
)
IN NS mail.redhat.com.
IN MX 10 mail.redhat.com.
1 IN PTR mail.redhat.com.
4> # chkconfig --level 2345 named on
# service named restart
四、配置sendmail服务器 [smtp]
1> # useradd -M -s /dev/null tom ; passwd tom
# useradd -M -s /dev/null jerry ; passwd jerry
# useradd -M -s /dev/null kitty ; passwd kitty
2> # vi /etc/mail/sendmail.mc //为测试方便,smtp认证可不作
DAEMON_OPTIONS(`Port=smtp,Addr=172.17.17.1, Name=MTA')dnl
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
3> # vi /etc/mail/local-host-names
mail
mail.redhat.com
redhat.com
localhost
localhost.localdomain
3> # vi /etc/aliases
admin: root,jerry
# newaliases
4> # vi /etc/mail/access
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
172.17.17 RELAY
redhat.com RELAY
rhel.net RELAY
# cd /etc/mail ; make access.db
5> # vi /etc/mail/sendmail.cw
rhel.net
# vi /etc/mail/virtusertable
jerry
# cd /etc/mail ; make virtusertable.db
6> # chkconfig --level 2345 sendmail on
# service sendmail restart
五、配置dovecot服务器 [pop3、imap]
1> # vi /etc/dovecot.conf
protocols = pop3 pop3s imap imaps
2> # chkconfig --level 2345 dovecot on
# service dovecot restart
六、配置webmail
1> # cp -rf /usr/share/squirrelmail/ /var/www/html/
# mv /var/www/html/squirrelmail /var/www/html/mail
# cd /var/www/html/mail/config
# rm -rf config.php config_local.php
# ln -s /etc/squirrelmail/config.php ./
# ln -s /etc/squirrelmail/config_local.php ./
2> # vi /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/mail"
Options Indexes
AllowOverride None
Order allow,deny
Allow from all
3> # chkconfig --level 2345 httpd on
# service httpd restart
七、测试邮件服务器
1> 测试账户:
2> 测试方式:
使用Foxmail等MUA软件配置测试
通过浏览器访问或登陆测试
阅读(1453) | 评论(0) | 转发(0) |