Cannot send email using PHP mail() function: Unable to rename '/usr/local/psa/handlers/spool/messageXXX' file: Permission denied

Follow

Comments

2 comments

  • Avatar
    Fran Le Bouleix (Edited )

    I ran into errors on CentOS7:

    libsepol.module_package_read_offsets: wrong magic number for module package:  expected 0xf97cff8f, got 0x4f44213c (No such file or directory).
    libsemanage.semanage_pipe_data: Child process /usr/libexec/selinux/hll/pp failed with code: 255. (No such file or directory).
    sendmail_rename_spool: libsepol.module_package_read_offsets: wrong magic number for module package:  expected 0xf97cff8f, got 0x4f44213c
    sendmail_rename_spool: Failed to read policy package
    libsemanage.semanage_direct_commit: Failed to compile hll files into cil files.
     (No such file or directory).
    semodule:  Failed!

     

    Here is how to use audit2allow to re-generate the module:

    1- Install audit2allow (part of setools)

     yum install policycoreutils-python

    2- Re-generate module

     egrep 'system_mail_t|httpd_sys_script_t' /var/log/audit/audit.log | audit2allow -M sendmail_rename_spool

    ******************** IMPORTANT ***********************
    To make this policy package active, execute:

    semodule -i sendmail_rename_spool.pp

    3- Run

      semodule -i sendmail_rename_spool.pp

     

  • Avatar
    Alexander Tsmokalyuk

    @Francoise Thank you, the article was updated.

Please sign in to leave a comment.

Have more questions? Submit a request