Exercise

Allow Apache to Send Email Exercise

Task

Find the SELinux boolean that lets Apache send email on servera, then turn it on permanently.

Host
servera
  1. Find the appropriate SELinux boolean

    The selinux-policy-doc package installs a man page for each SELinux domain, named with an _selinux suffix.

    sudo dnf install selinux-policy-doc -y
    man -k _selinux | grep httpd
    man 8 httpd_selinux

    Type /mail and press Enter to search, press n for the next match, and press q to quit.

  2. View the current value of the boolean

    getsebool httpd_can_sendmail
    sudo semanage boolean -l | grep httpd_can_sendmail

    semanage shows two values in parentheses: the current value, then the default.

  3. Permanently set the boolean

    sudo setsebool -P httpd_can_sendmail on
  4. Verify the boolean is set

    getsebool httpd_can_sendmail
    sudo semanage boolean -l | grep httpd_can_sendmail

    Both values now read on.

  5. Clean up

    sudo setsebool -P httpd_can_sendmail off
    sudo dnf remove -y selinux-policy-doc