Linux下配置邮件服务器
版权声明:原创作品,谢绝转载!否则将追究法律责任。 |
实验一:搭建Sendmail服务
1. 配置DNS,添加MX记录
# service named start
# vi /etc/named.conf
zone “aaa.com” IN {
type master;
file “aaa.com.dns”;
};
# cd /var/named
# ls
# cp named.local aaa.com.dns
# vi aaa.com.dns
$ TTL 86400
19970220700 ; Servial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
aaa.com IN MX 10 www.aaa.com.
www IN A 192.168.1.150
# service named restart
在windows上把dns指向192.168.1.150
使用nslookup查看
nslookup
set type=mx .or. set type=any
aaa.com
ping www.aaa.com
2. 启动POP3服务
# vi /etc/xinetd.d/ipop3
disable=no
# service xinetd restart
# nmap 192.168.1.150 查看当前系统打开的端口
3. 启动SMTP服务
# vi /etc/mail/sendmail.cf
Addr=192.168.1.150 进入配置文件,把IP地址改成本机地址
# service sendmail restart
4. 设置邮件接收域
# vi /etc/mail/local-host-names
aaa.com 添加一个域名
5. 设置邮件发送中继
# cd /etc/mail
# vi access
aaa.com RELAY
# makemap hash access.db < access
6. 重启服务
# service sendmail restart
7. 创建用户
# useradd a01
# passwd a01
# 输入密码
# useradd a02
# passwd a02
# 输入密码
8. 客户端用服务器上所创建好的2个用户,进行邮件转发。
实验二:设置邮件的别名
1.添加别名
①添加用户别名
# vi /etc/aliases 添加别名
# newaliases 更新别名
②添加邮件别名
# cd /etc/mail
# vi sendmail.cw
sohu.com 添加别名
aaa.com 原来的域名
# vi /etc/mail/local-host-names
sohu.com
2.添加一个Sohu的正向解析配置文件
# vi /etc/named.conf
zone “sohu.com” IN {
type master;
file “sohu.com.dns”;
};
# cd /var/named
# cp aaa.com.dns sohu.com.dns
# vi sohu.com.dns
$ TTL 86400
19970220700 ; Servial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
sohu.com IN MX 9 www.sohu.com.
www IN A 192.168.1.150
3.重启服务
# service named reload
# service sendmail restart
实验三:SMTP认证
# rpm -qa |grep sasl 检查软件包安装是否安装
# mount /dev/cdrom /mnt/cdrom 挂载安装光盘
# cd /mnt/cdroom /redhat/rpms
# rpm -ivh cyrus-sasl-gssapi -
# cd /etc/mail
# m4 sendmail.mc > sendmail.cf
# vi sendmail.mc
TRUST_AUTH_MECH ('EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define ('confAUTH_MECHANISMS', 'EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN ')dnl
DAMON_OPTIONS ('Port=submission, Name=MSA, M=Ea')dnl
去掉这3行前面的注释标记
DAMON_OPTINS ('Port =smtp,Addr=192.168.1.150,Name=MTA')dnl
将Addr指向本机IP
# m4 sendmail.mc > sendmail.cf
# service sendmail restart
本文出自 “技术论坛” 博客,谢绝转载! 本文出自 51CTO.COM技术博客 |


mandaizixun
博客统计信息
热门文章
最新评论
友情链接