器量大者,福泽必厚
全部博文(587)
分类: LINUX
2014-01-02 17:04:48
下面还需要对sendmail进行配置,
首先我们看一下linux sendmail基本配置:
查看hosts
#more /etc/hosts
::1
localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 localhost.localdomain localhost
localhost4.localdomain4 localhost4
# Auto-generated hostname. Please do not
remove this comment.
127.0.0.1 vps1.ku***y.com vps1
查看mail/access
more /etc/mail/access
# Check the /usr/share/doc/sendmail/README.cf
file for a description
# of the format of this file. (search for
access_db in that file)
# The /usr/share/doc/sendmail/README.cf is
part of the sendmail-doc
# package.
#
# If you want to use AuthInfo with
"M:PLAIN LOGIN", make sure to have the
# cyrus-sasl-plain package installed.
#
# By default we allow relaying from
localhost...
Connect:localhost.localdomain
RELAY
Connect:localhost
RELAY
Connect:127.0.0.1
RELAY
more /etc/mail/local-host-names
# local-host-names - include all aliases
for your machine here.
vps1.ku***y.com
重启sendmail
测试:
telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 vps1.kuuplay.com ESMTP Sendmail 8.14.4/8.14.4;
Tue, 16 Apr 2013 11:03:10 +0800
发送邮件:
mail -s test < vhost.sh ##在防火墙上务必开放25端口
查看QQ邮箱,确保邮件正常收到
下面是配置报警:
管理—>示警媒体类型-----》选中email
有如图所示:
然后添加接收人,添加方法:
选中右上角的 基本资料----》示警媒体------》点添加按钮即可!
Zabbix 发邮件
1:
[root@zabbixserver ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
127.0.0.1 zabbixserver.kuucity.com zabbixserver
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@zabbixserver ~]# hostname
zabbixserver.kuucity.com
添加 127.0.0.1 zabbixserver.kuucity.com zabbixserver
2:修改主机名为zabbixserver.kuucity.com
hostname zabbixserver.kuucity.com
3:开启postfix
/etc/init.d/postfix start
4:测试postfix发邮件
[root@zabbixserver clientmqueue]# mail -s "Hello Xiaojie" lxj09**0@ly.com < /root/a.java
[root@zabbixserver clientmqueue]# mail -s "Hello Xiaojie" 147****560@139.com < /root/a.java
[root@zabbixserver clientmqueue]# mail -s "Hello Xiaojie" kmrootkmroot@163.com < /root/a.java
如果能发送成功,说明postfix工作正常