[root@ssticentos65 ~]# yum -y install sendmail #在线yum安装sendmail [root@ssticentos65 ~]# /etc/init.d/sendmail start #启动sendmail服务 [root@ssticentos65 ~]# /etc/init.d/sendmail status #查看sendmail启动情况 sendmail dead but subsys locked #sendmail进程锁住,原因是postfix服务启动导致sendmail服务进程锁住,需要关闭postfix服务。 sm-client (pid 1759) is running... [root@ssticentos65 ~]# /etc/init.d/postfix stop #暂停postfix服务提示失败,原因是postfix进程正在使用,需要使用kill命令杀掉postfix进程 Shutting down postfix: [FAILED] [root@ssticentos65 ~]# /etc/init.d/postfix status #查看postfix服务可以查看到进程号 master (pid 1647) is running... [root@ssticentos65 ~]# kill -9 1647 #杀掉postfix服务进程号 [root@ssticentos65 ~]# /etc/init.d/postfix status #查看postfix状态 master dead but pid file exists [root@ssticentos65 ~]# chkconfig postfix off #设置postfix开机不启动 [root@ssticentos65 ~]# /etc/init.d/sendmail stop #暂停sendmail服务 Shutting down sm-client: [ OK ] Shutting down sendmail: [FAILED] [root@ssticentos65 ~]# /etc/init.d/sendmail start #启动sendmail服务 Starting sendmail: [ OK ] Starting sm-client: [ OK ] [root@ssticentos65 ~]#
外部邮箱直接看这里
1、安装邮件发送工具mailx
1
yum -y install mailx
2、配置mailx(配置外部邮箱需要外部邮箱开启pop imap smtp,具体可上网查找)
1 2 3 4 5 6 7
vim /etc/mail.rc
set from=detective19910204@163.com #163注册的个人邮箱,用于zabbix服务端转发邮件到指定邮箱 set smtp=smtp.163.com #填写163发送邮箱服务器地址smtp set smtp-auth-user=detective19910204 #163个人邮箱账号 set smtp-auth-password=XXXXXXXXXXXX #163个人邮箱开启的授权密码 set smtp-auth=login #登录