本文说明了在 CentOS/RHEL 5 和 6 上使用 postfix 配置 smtp 中继的步骤。
要通过另一个 smtp 服务器中继邮件,必须使用指定目标 smtp 服务器的“relayhost”参数配置 /etc/postfix/main.cf 文件。
- 如果还没有安装 postfix rpm,请安装。
# rpm -qa|grep postfix
- 备份默认配置:
# cp /etc/postfix/main.cf /etc/postfix/main.cf.bkp_default
- 编辑 /etc/postfix/main.cf 并在配置中添加/修改以下参数。
myhostname = [hostname-of-server] relayhost = [IP Address/Hostname of relay server]
- 重启postfix服务使修改生效。
# service postfix restart
- 使用 telnet/mail(mailx) 命令验证邮件中继。
日期:2020-09-17 00:13:22 来源:oir作者:oir