wordpress-develop icon indicating copy to clipboard operation
wordpress-develop copied to clipboard

Adding Mailhog Support

Open SirLouen opened this issue 7 months ago • 2 comments

Adding support for a mailhog container on demand with the env variable: LOCAL_MAILHOG

Patch Testing instructions:

  1. Change LOCAL_MAILHOG=false to LOCAL_MAILHOG=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.

SirLouen avatar Mar 20 '25 16:03 SirLouen