2、
开始监控邮件想用sendmail,但问题百出。于是用linux自带的postfix,把命令行放到脚本里即可。
1>关闭selinux
[root@bogon ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
2>关闭防火墙
service iptables off
chkconfig iptables off
3>关闭sendmail
service sendmail stop
chkconfig sendmail off
4>开启postfix
service postfix restart
chkconfig postfix on
5>保证sendmail关闭,postfix开启
[root@bogon ~]# service postfix status
master (pid 53164) 正在运行...
[root@bogon ~]# service sendmail status
sendmail 已停
sm-client 已停
现在用postfix相当于foxmail一样,都属于客户端,用客户端主动去连接服务器端,然后发送邮件。
以QQ企业邮箱为例,首先在邮箱客户端设置如下,开启SMTP,有什么授权验证码的自行解决处理:
postfix端配置如下:
FROM 填自己的邮箱,SMTP,SMTP-AUTH-USER填自己邮箱,PASSWORD填密码,方式LOGIN。