Repository navigation
fix(install): PHP mail works under SELinux on AlmaLinux and Rocky - #195
Merged
Merged
Conversation
With PHP mail (Setup -> General -> Mail, the default selection there) a web request hands the email to the local sendmail. On a clean Rocky Linux 9 server with Postfix the test email failed with 'Connection to "process /usr/sbin/sendmail -bs -i" has been closed unexpectedly', for two SELinux denials in turn: PHP-FPM may not run sendmail (httpd_can_sendmail is off), and with that boolean on, sendmail started as -bs may not start Postfix's smtpd. The installer now sets httpd_can_sendmail and, on the RHEL family, MAIL_SENDMAIL_PATH="/usr/sbin/sendmail -t -i" in .env. Mail the scheduler sends was never confined and is unchanged.
The two settings the installer now makes, for a server set up by hand, and the error that shows without them.
Owner
|
Thank you @ertugrulkeyvan, merged in 5fb5d8d. Tracing both denials one after the other, and checking that the scheduler's mail was never affected, made this easy to follow. What we checked:
This will be part of the next release. |
Panelica
pushed a commit
that referenced
this pull request
Oct 21, 2026
Selling Panelica licenses with a partner account (the Panelica Licenses page, the module, the customer's own install command), knowledge base and announcements in more than one language (#201, #203), the knowledge base search (#202), retrying a refused domain registration (#197), keeping the card that paid (#209), reports and statuses in the admin's language (#208, #205), the Panelica module's messages in the customer's language (#199), the registrant's phone on domain orders (#196), panel sign-in by name (#200), and the fixes of #193, #194, #195, #198, #204, #206 and #207. Database: three new translation tables. A MINOR beta, the second of 1.6.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
I ran the new
install.shon a clean Rocky Linux 9.8 (SELinux enforcing, firewalld on). The install, the wizard and an update from Setup -> Updates to 1.6.0-beta.1 all worked with no SELinux denials. One thing did not: PHP mail, the default selection under Setup -> General -> Mail.With Postfix installed, the test email failed with
Connection to "process /usr/sbin/sendmail -bs -i" has been closed unexpectedly. The audit log showed two denials, one after the other:httpd_t) may not run sendmail:httpd_can_sendmailis off by default (denied { read } comm=sendmail name=main.cf).system_mail_t, and Laravel's defaultsendmail -bsmakes Postfix start itssmtpd, which that domain may not execute (denied { execute } comm=sendmail name=smtpd).With the boolean on and
MAIL_SENDMAIL_PATH="/usr/sbin/sendmail -t -i", the test email reached the mailbox and the audit log stayed empty. Mail sent by the scheduler runs unconfined and was never affected, so only mail sent during a web request failed: the test button, and anything mailed straight from a page.How
configure_selinux: alsosetsebool -P httpd_can_sendmail 1.install_app: on the RHEL family,MAIL_SENDMAIL_PATH="/usr/sbin/sendmail -t -i"is written to.envwith the other values, throughEnvWriteras before. Ubuntu and Debian are unchanged.docs/install/native.mdstep 10: the same two settings for a server set up by hand, and the error that shows without them.Tests
On the same Rocky 9 server, I cleaned it and installed again with this
install.sh:httpd_can_sendmailcame out on,.envhad the sendmail path, and the test email was delivered with no denial. An emptymail_envarray expands to nothing underset -u; checked with bash 3.2 and 5.bash -n install.shpasses. There is no test suite for the shell installer.