Zabbix+postfix发送邮件

1410阅读 0评论2015-04-15 qingheliu
分类:LINUX

系统环境:centos6.3 x64

zabbix:zabbix-2.06(简体中文)

postfix: 系统自带


一.配置本机postfix配合zabbix邮件发送


1.本机若安装sendmail,则必须关闭并卸载。

# service sendmail stop

# chkconfig sendmail off    

# rpm -e sendmail --nodeps


2.安装postfix (centos6.3下默认yum源,默认postfix系统自带)

# yum install postfix -y


更改postfix配置文件中的参数

# postconf -e myhostname=mail.zabbix.example.cn

# postconf -e myorigin=zabbix.example.cn

# postconf -e mydomain=zabbix.example.cn

# postconf -e mydestination=localhost

# postconf -e mynetworks=127.0.0.0/8

配置完成会添加参数到/etc/postfix/main.cf下末行


# vi /etc/hosts

添加一行:

------------

127.0.0.1 mail.zabbix.example.cn zabbix.example.cn

------------


重启postfix服务

# service postfix restart

测试发送一封邮件到公网邮箱

# mail abc@example.com

动态查看发送的邮件日志

# tail -f  /var/log/maillog

若远程邮箱收到,则配置成功
添加个自己的邮箱就可以了


还遇到一个问题:
 A44D62603A1: to=, relay=none, delay=0.66, delays=0.02/0/0.63/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=centos.j*d.com type=A: Host not found
解决方法:
 postconf -e 'smtp_host_lookup = dns, native'
/etc/init.d/postfix restart
问题即可解决!




##亲测有用
##转载于 

http://showerlee.blog.51cto.com/2047005/1202570
向原作者表示感谢!


上一篇: Zabbix email中添加url
下一篇:zabbix性能常见问题