2014年5月1日

讓SELinux可以透過httpd(PHP)寄信

SELinux開啟時

預設是無法直接由網站寄信的

可以先查看設定值


getsebool httpd_can_sendmail

一開始都是 off

然後

setsebool -P httpd_can_sendmail 1


chcon -t httpd_sys_content_t /usr/sbin/sendmail.postfix 

就可以透過網站(PHP)送信了

必要時可檢查與恢復postfix相關權限

# /etc/init.d/postfix stop
# chgrp postdrop /usr/sbin/postqueue
# chgrp postdrop /usr/sbin/postdrop
# chmod g+s /usr/sbin/postqueue
# chmod g+s /usr/sbin/postdrop
# /etc/init.d/postfix start

沒有留言:

張貼留言