当有人向我的服务器发送电子邮件时,例如
somestringthatisnotnecessarilyauser@myserver.com
Run Code Online (Sandbox Code Playgroud)
我希望它通过管道传输到 PHP 脚本。所以在我的
/etc/aliases
Run Code Online (Sandbox Code Playgroud)
我有文件:
somestringthatisnotnecessarilyauser: "|/path/to/php/script.php"
Run Code Online (Sandbox Code Playgroud)
在禁用 SELinux 的情况下,它可以完美地将电子邮件发送到 PHP 脚本。
启用 SElinux 后,邮件日志出现权限错误:
local[19660]: fatal: execvp /path/to/php/script.php: Permission denied
Run Code Online (Sandbox Code Playgroud)
我对 SELinux 很陌生,但我已将问题归结为 SELinux,因为禁用它后,它可以正常工作。
有谁知道我需要申请哪些 semanage 命令或其他策略才能在启用 SELinux 的情况下使用它?
操作系统是 Centos6.5 64 位
以下是向地址发送电子邮件时 /var/log/audit/audit.log 所说的内容:
type=AVC msg=audit(1395174916.444:476603): avc: denied { search } for pid=25396 comm="local" name="web" dev=dm-0 ino=522246 scontext=unconfined_u:system_r:postfix_local_t:s0 tcontext=unconfined_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=SYSCALL msg=audit(1395174916.444:476603): arch=c000003e syscall=59 success=no exit=-13 a0=7feaddb404a0 a1=7feaddb40470 a2=7feaddb3b2d0 a3=7fffa4fe93d0 items=0 ppid=21187 pid=25396 auid=500 uid=99 gid=99 euid=99 suid=99 fsuid=99 egid=99 sgid=99 fsgid=99 tty=(none) ses=69836 comm="local" …
Run Code Online (Sandbox Code Playgroud)