您的位置:首页 > 运维架构 > Linux

解决CentOS下无法发送邮件的问题 + selinux

2017-09-28 15:34 363 查看
In the newer Fedoras (and perhaps other Linux installations). SELinux is set to enforce by default, one of the areas you'll notice this causing issues is with mail (whether connecting via port 25 to SMTP, or using PHP mail().

The solution to both of these scenarios is as follows:

To allow PHP/Apache to connect to port 25 issue the following commands as root:

setsebool -P httpd_can_network_connect=1

To allow PHP mail() to work issue the following command as root:

setsebool -P httpd_can_sendmail=1

This should fix both issues.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: