问题原文
原帖链接 · MG55114 · CC BY-SA 3.0
I am trying to set up a postfix server for smtp relay. Centos 5.5
I have followed http://mhawthorne.net/posts/postfix-configuring-gmail-as-relay.html but am getting a FAILED error when trying to restart or reload postfix.
When I do:
cat maillog
I get:
fatal: open /etc/postfix/main.cf: Permission denied
Here is what I have tried:
chown postfix /etc/postfix/main.cf
chmod u+rwx /etc/postfix/main.cf
After that, I do:
ls -l /etc/postfix/main.cf
Which gives me:
-rwx------. 1 postfix anotheruser 27531 Apf 29 12:19 /etc/postfix/main.cf
No dice. Same error. I even tried temporarily doing chmod 777 but got same error.
Any ideas on the permissions problem? I am assuming it is running the service as the postfix user.
Thanks
社区高分解答
原帖链接 · Metafaniel · CC BY-SA 3.0
In my case, the other answers didn't helped me, because I already had the context for those files correctly. Even if the file's correct context are applied, you'll also need to be sure the Apache user has SELinux permission to send mails. Specifically there is a SELinux configuration that need to be turned on.
- Verify if the setting is on or off:
getsebool httpd_can_sendmail - If you got
httpd_can_sendmail --> offyou can enable this setting this way:sudo setsebool -P httpd_can_sendmail 1
-P in the above command means Persistent (across reboots)
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
