Skip to content

sendmail_path from the environment, php image independent of mail settings; 4.5.68 - #269

Merged
faradey merged 2 commits into
masterfrom
staging
Nov 20, 2026
Merged

faradey merged 2 commits into
masterfrom
staging

Conversation

@faradey

@faradey faradey commented Nov 20, 2026

Copy link
Copy Markdown
Owner

PHP's sendmail_path now comes from the container's environment, so the php image no longer depends on where mail goes.

  • php.ini reads sendmail_path = "${MADOCK_SENDMAIL_PATH}" in every project; the compose file gives the value to php, php without Xdebug, workers and the Shopware/Sylius messengers.
  • The value is msmtp with php/sendmail/host, port and from, or /usr/sbin/sendmail -t -i when php/sendmail/enabled is false. Computed last in the derived rules, after the muted-clone rule and extensions.
  • Host, port and sender are checked before the image is written (they become a command PHP runs through /bin/sh); a bad value is refused with the key named.
  • Before: a muted clone, which sends to its own envelope address, rebuilt every layer after this line; no two clones shared them.

Tests:

  • TestPhpImageDoesNotDependOnTheMailSettings (render): fails with the sender back in the Dockerfile and with the variable taken out of compose.
  • TestSendmailRefusesWhatIsNotAHostAPortOrAnAddress: fails with the host check reduced to non-empty. TestMutedCloneSendmailPathIsTheMutedOne: fails with the value computed before the muted-clone rule.
  • e2e TestPhpImageIsTheSameWhateverTheMailSettings: two projects with different mail share all 28 layers, CLI and php-fpm each read their own value, a default mail() arrives in mailpit, a sender change needs no new image. Passed on a fresh VM (289 s); with the sender back in the Dockerfile it fails: 28 and 28 layers, shared prefix 17.

Also: the e2e VM's docker readiness probe asks the daemon as root. It ran in Lima's persistent SSH session opened before the user joined the docker group and timed out on permission denied three runs in a row.

4.5.68.

The probe runs in Lima's persistent SSH session, opened before provisioning
adds the user to the docker group, so as the user docker info kept answering
permission denied until the timeout while the daemon had been up for minutes.
Three up runs in a row failed on it on 2026-11-20, one with a 25-minute
timeout. cmd_up's restart still gives the user its own access.
php.ini now reads sendmail_path = "${MADOCK_SENDMAIL_PATH}" in every project
and the compose file gives each PHP service the value (msmtp with
php/sendmail/host, port and from, or the system sendmail when off). The mail
settings used to be written into the image, which made that line the first
difference between a template and its muted clone: the clone rebuilt every
layer after it, and no two clones shared them.

Host, port and sender become a command PHP runs through /bin/sh, so they are
checked before the image is written. Unit tests were broken four ways (sender
back in the Dockerfile, variable out of compose, host check reduced to
non-empty, value computed before the muted-clone rule) and each failed; the
e2e TestPhpImageIsTheSameWhateverTheMailSettings fails with the sender back in
the Dockerfile: 28 layers, shared prefix 17.
@faradey faradey added the full-e2e Run the whole end-to-end suite and Platforms on this pull request label Nov 20, 2026
@faradey
faradey merged commit 649c0b9 into master Nov 20, 2026
15 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-e2e Run the whole end-to-end suite and Platforms on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant