大网数据广告活动
服务器运维问答

POSTFIX main.cf permission denied

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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.

  1. Verify if the setting is on or off: getsebool httpd_can_sendmail
  2. If you got httpd_can_sendmail --> off you can enable this setting this way: sudo setsebool -P httpd_can_sendmail 1

-P in the above command means Persistent (across reboots)

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-04-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。