CentOSでsendmailのエラー

SELinuxがアップデートされたせいか、CGIからsendmailを呼んでメールを出していた部分がエラーになっていた…。

sendmail: warning: premature end-of-input on /usr/sbin/postdrop -r while reading input attribute name,
referer: http://...
sendmail: fatal: apache(48): unable to execute /usr/sbin/postdrop -r: Success,
referer: http://...

以下の方法で対処した。

適当なディレクトリを作って、以下のmypostfix.teファイルを作る。

policy_module(mypostfix, 1.0)
gen_require(`
type sendmail_t;
type postfix_postdrop_t;
')
allow postfix_postdrop_t sendmail_t:unix_stream_socket { getattr read write ioctl };

そんで以下を実行。

# make -f /usr/share/selinux/devel/Makefile
# semodule -i mypostfix.pp

こういうアップデートを自動でされると痛いな…。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です