Skip to content

feat: support mailpit for local email trap #6

@damienwebdev

Description

@damienwebdev

The devcontainer currently has no mechanism for local email testing. PHP's sendmail_path is baked into the base mappia/magento-php Docker image and cannot be overridden without modifying the image or manually mounting a custom php.ini.

This means transactional emails (order confirmations, password resets, etc.) either silently fail or require an external SMTP service during local development.

What I would like to see:

  • Add a https://github.com/axllent/mailpit service to each version-specific compose file (compose/2.4.6/, 2.4.7/, 2.4.8/, 2.4.9/)
  • Make sendmail_path configurable via environment variable so it can point to the Mailpit sendmail binary. (@damienwebdev )

@tjzijlstra was kind enough to put together a little sample config:

https://gist.github.com/tjzijlstra/600551811c8627e6e2867fab421613b8

I suspect the only ini contents we will need are:

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; https://php.net/sendmail-path
sendmail_path="/usr/local/bin/mailpit sendmail -t --smtp-addr 127.0.0.1:1025"

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; Use mixed LF and CRLF line separators to keep compatibility with some
; RFC 2822 non conformant MTA.
mail.mixed_lf_and_crlf = Off

I'm not 100% certain we need mail.add_x_header and mail.mixed_lf_and_crlf. We will need to test these.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions