RHEL6.0 简单(smtp)邮件服务器搭建
系统环境:rhel6.0-x86_64
dns server:192.168.0.44
mail server:192.168.0.5
client host: 192.168.0.6
smtp server:192.168.0.7(转发邮件)
在192.168.0.44配置DNS服务器
安装dns软件 yum install bind bind-chroot bind-utils bind-libs -y
vim /etc/named.conf
# listen-on port 53 { 127.0.0.1; };
# allow-query { localhost; };
zone "." IN {
type hint;
file "named.ca";
};
zone "example.com" IN {
type master;
file "example.com.zone";
};
配置域名正向解析文件
cp /var/named/named.localhost /var/named/example.com.zone -p
chown named.namd /var/namd/example.com.zone
vim /var/named/example.com.zone
$TTL 1D
@ IN SOA @ root. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 192.168.0.44
server5 A 192.168.0.5
mail CNAME server5
server6 A 192.168.0.6
client CNAME server6
server7 A 192.168.0.7
smtp CNAME server7
example.com. IN MX 10 mail.example.com.
~
example.com的DNS的MX记录必须指向邮件服务器mail.example.com
****注意域后面的点****
启动DNS server
/etc/init.d/named start
若有没有报任何错,则文件无语法错误,可以用dig进行测试,若dig成功的解析出ip,dns配置成功
开始邮件服务器的搭建
mail server在192.168.0.5主机上配置
postfix ----> 邮件传输代理软件
安装接受邮件的软件dovecot,yum install dovecot postfix -y
postconf -e inet_interfaces = all
postconf -e mydestination = example.com
postconf -e myorigin = example.com
postconf -e relayhost = stmp.example.com
}