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
-
Find the appropriate SELinux boolean
The
selinux-policy-docpackage installs a man page for each SELinux domain, named with an_selinuxsuffix.sudo dnf install selinux-policy-doc -y man -k _selinux | grep httpd man 8 httpd_selinuxType
/mailand press Enter to search, pressnfor the next match, and pressqto quit. -
View the current value of the boolean
getsebool httpd_can_sendmail sudo semanage boolean -l | grep httpd_can_sendmailsemanageshows two values in parentheses: the current value, then the default. -
Permanently set the boolean
sudo setsebool -P httpd_can_sendmail on -
Verify the boolean is set
getsebool httpd_can_sendmail sudo semanage boolean -l | grep httpd_can_sendmailBoth values now read
on. -
Clean up
sudo setsebool -P httpd_can_sendmail off sudo dnf remove -y selinux-policy-doc