安裝:aptitude install sendmail
設置主機名:vim /etc/hostname
zabbix.company.com
vim /etc/hosts
127.0.0.1 localhost zabbix.company.com localhost.localdomain
X.X.X.X zabbix.company.com #主機ip地址
開啓sendmail發郵件功能:
#vim /etc/mail/sendmail.mc
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
更改成:將它修改爲如下,表明接收任何地方的連接。
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
:wq保存退出
#mv sendmail.cf sendmail.org #備份sendmail配置文件
#m4 sendmail.mc sendmail.cf #重新生成配置文件
注意:如果在執行"m4 sendmail.mc >sendmail.cf"命令時卻收到了"sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory"錯誤信息,那表明你沒有安裝sendmail-cf包,但我沒有碰到。