Skip to content

sendmail_path is the php image's last step again; 4.5.69 - #270

Merged
faradey merged 1 commit into
masterfrom
staging
Nov 20, 2026
Merged

faradey merged 1 commit into
masterfrom
staging

Conversation

@faradey

@faradey faradey commented Nov 20, 2026

Copy link
Copy Markdown
Owner

4.5.69: PHP's sendmail_path is written into php.ini again, as the php image's last step.

4.5.68 (tagged -norelease, never released) kept the value in the container's environment. php-fpm and docker exec saw it, but cron starts its jobs with an environment of its own, so every mail() from a cron job got an empty sendmail_path and returned false.

Now the line is at the end of the footer snippet. A muted clone, the only project that differs from its template in this line, rebuilds that one layer instead of the 14 after the old position. The compose files no longer carry MADOCK_SENDMAIL_PATH.

Tests (each was broken on purpose and seen failing):

  • Unit test TestTheMailSettingsChangeOnlyTheLastLayerOfThePhpImage. Fails when a layer follows the step, when the Dockerfiles differ anywhere else, or when the compose file carries the value.
  • e2e test TestTheMailSettingsChangeOnlyTheLastLayerAndReachCron. Checks that two projects share 27 of 28 layers and that mail() reaches mailpit both from docker exec and from a cron job. With 4.5.68's templates the cron check fails; with the line in the middle of the image the layer check fails (shared prefix 17).

….5.69

4.5.68 moved PHP's sendmail_path into the container's environment
(sendmail_path = "${MADOCK_SENDMAIL_PATH}" with the value in the compose
file). php-fpm and docker exec saw it; cron jobs did not. cron starts its
jobs with an environment of its own, so on a 4.5.68 image every mail() from
cron got an empty sendmail_path and returned false. Measured on a temporary
project: docker exec read the msmtp command, a www-data cron job read ''
and mail() returned false. 4.5.68 was tagged -norelease and never reached a
machine.

The value is written into php.ini again, but as the last step of the image
(end of the footer snippet, after the entrypoint script; only ENTRYPOINT and
CMD follow). It is still the one line that differs between a template and
its muted clone, so a clone now rebuilds that layer alone instead of the 14
after it. The compose files no longer carry MADOCK_SENDMAIL_PATH. The host,
port and sender are still validated before render, now because they are
pasted into a RUN line; the build fails if the line did not land in both
php.ini files.

Tests, each broken and seen failing:
- TestTheMailSettingsChangeOnlyTheLastLayerOfThePhpImage fails with a RUN
  added after the step, with the sender reaching another RUN, and with the
  variable back in php.yml.
- e2e TestTheMailSettingsChangeOnlyTheLastLayerAndReachCron (green, 259 s):
  two projects with different mail share 27 of 28 layers, CLI and php-fpm
  read their own values, mail() reaches mailpit from docker exec and from a
  cron job, a new sender after rebuild changes the last layer only. With
  4.5.68's templates the cron part fails (the job saw '' and false); with
  the line back in php/ini the layer checks fail: 28 and 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 809ea0d 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