配通Sendmail 【入门级别】
1.首先搭建可用的DNS环境,为真实邮件交换环境作准备
2.修改/etc/mail/access,加入对受信任IP的RELAY
##############################################################
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
192.168.1.26 RELAY #这行是加进去的
##############################################################
3.生成access.db
运行命令: makemap hash /etc/mail/access.db < /etc/mail/access
4.修改sendmail.cf,插入监听接口IP
##############################################################################
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
O DaemonPortOptions=Port=smtp,Addr=192.168.1.253, Name=MTA #这行是加进去的
##############################################################################
5.起sendmail,用netstat -na看是否在接口监听?
6.测试本机不同用户之间互发邮件,如root发给cdfn,内容为rc.local文件内容
命令: mail -s test < /etc/rc.local
注意一定要用@localhost,非对外域名,否则会收到退回的邮件,报如下的错误:
554 5.0.0 MX list for linux.org. points back to rhel.linux.org
554 5.3.5 Local configuration error
如果测试成功,基本没问题了
7.测试真实环境下,通过两台MTA互发邮件
一些细节:
真实环境下,注意修改/etc/hosts中的本机名localhost.localdomain为类似rhel.linux.org,对方看到的发件人将类似 (似乎把主机名取为linux.org更好看哦?)
![](http://control.cublog.cn/fileicon/rar.gif) |
文件: |
Sendmail配置文件.rar |
大小: |
15KB |
下载: |
下载 | |
阅读(602) | 评论(0) | 转发(0) |