Postfix won’t run while selinux in enforcing mode

postfixselinux

I enabled selinux forcing mode on Fedora 15 , and I was able to get apache, mysql and memcached to work fine , but I couldn't get postfix to run .

I got the following errors :

 systemd[1]: Unit postfix.service entered failed state.
kernel: [146194.117602] type=1400 audit(1318924444.361:3809): avc:  denied  { module_request } for  pid=15447 comm="postfix" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system
kernel: [146194.145456] type=1400 audit(1318924444.389:3810): avc:  denied  { module_request } for  pid=15452 comm="master" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system
kernel: [146194.146585] type=1400 audit(1318924444.390:3811): avc:  denied  { module_request } for  pid=15452 comm="master" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system
kernel: [146194.390715] type=1400 audit(1318924444.633:3812): avc:  denied  { module_request } for  pid=15479 comm="postsuper" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system
kernel: [146194.451670] type=1400 audit(1318924444.694:3813): avc:  denied  { module_request } for  pid=15516 comm="postlog" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system
kernel: [146194.459587] type=1400 audit(1318924444.702:3814): avc:  denied  { module_request } for  pid=15517 comm="master" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system
kernel: [146194.460786] type=1400 audit(1318924444.703:3815): avc:  denied  { module_request } for  pid=15517 comm="master" kmod="net-pf-10" scontext=system_u:system_r:postfix_master_t:s0 tcontext=system_u:system_r:kernel_t:s0 tclass=system
systemd[1]: PID 15517 read from file /var/spool/postfix/pid/master.pid does not exist. Your service or init script might be broken.
systemd[1]: postfix.service: main process exited, code=exited, status=1

following steps were done :

  1. I reinstall postfix
  2. Created .autorelable and reboot
  3. restorecon -R -v /etc/postfix restorecon -R -v /var/lib/postfix

Can someone tell me what am doing wrong ?

Update
It turns out that we have to disable the ipv6 in the main.cf and these errors were disappear.

THank you

Best Answer

If you ever need ipv6 enabled, the way to solve this would be to build and install a custom SELinux policy, based on these errors:

# grep postfix_master /var/log/audit/audit.log | audit2allow -m postfixCustom > postfix.te
# checkmodule -M -m -o postfix.mod postfix.te
# semodule_package -m postfix.mod -o postfix.pp 
# semodule -i postfix.pp
Related Topic