Skip to content

Adding Mailpit Support#8555

Open
SirLouen wants to merge 8 commits intoWordPress:trunkfrom
SirLouen:patch/63135
Open

Adding Mailpit Support#8555
SirLouen wants to merge 8 commits intoWordPress:trunkfrom
SirLouen:patch/63135

Conversation

@SirLouen
Copy link
Member

@SirLouen SirLouen commented Mar 20, 2025

Adding support for a Mailpit container on demand with the env variable: LOCAL_MAIL

Patch Testing instructions:

  1. Change LOCAL_MAIL=false to LOCAL_MAIL=true in your .env file
  2. Run your docker environment as usual npm run env:start
  3. You test if your mailhog instance is running with either:
    A) Go to http://localhost:8025/
    B) You can run in your wordpress-develop container
docker exec -it  wordpress-develop-php-1 openssl s_client -connect mailhog:1025

And it might result in something like:

CONNECTED(00000003)
135865530688832:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:331:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 5 bytes and written 283 bytes
Verification: OK
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
No ALPN negotiated
Early data was not sent
Verify return code: 0 (ok)

C) You can do further tests, like sending an email with a plugin that uses the local mailhog hostname
For example this one: https://github.com/SirLouen/amazon-s3-email-testing/archive/refs/tags/1.0.0.zip

Trac ticket: https://core.trac.wordpress.org/ticket/63135


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link

github-actions bot commented Mar 20, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props sirlouen, mindctrl.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@mindctrl
Copy link

@SirLouen is there anything left to do here?

@SirLouen
Copy link
Member Author

@mindctrl yeah this is still of phase 1.
But I'm using this mainly to drag it as a patch and test reports that need something relating with Mail component.
I don't think it will get through as-is right now.

@mindctrl
Copy link

@SirLouen could you add a list of things left to do in the opening description? We have a 6.9 milestone and I'd love to help get it in the proper state for a committer to review/merge. I've needed local mail testing multiple times recently. WCUS Contributor Day is coming up and I know a few people willing to help.

@SirLouen
Copy link
Member Author

@mindctrl I think it's time to de-milestone this. I was confident that this could be a great addition to wordpress-develop, but for now it's not adding value in the line that is expected (according to one dev-chat some months ago)

My idea is to look to add extra value to this, but this is not going to happen anytime soon, and I seriously doubt it will make it on time for 6.9. This PR by itself is useful for someone like me that uses this PR like every other day, but useless for most of the people that seldom test anything—mail. Hope to see it merged somewhere in the future, but much work is needed to consider it a potential merge (mainly creating integration tests in PHPUnit that make use of this service).

I've updated the milestone so we don't need to rush it anymore.

@SirLouen SirLouen changed the title Adding Mailhog Support Adding Mailpit Support Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants