Make WordPress Core

Opened 5 weeks ago

Last modified 27 hours ago

#63135 new enhancement

Testing and Debugging WP_Mail related topics

Reported by: sirlouen's profile SirLouen Owned by:
Milestone: 6.9 Priority: normal
Severity: minor Version: trunk
Component: Build/Test Tools Keywords: has-patch needs-testing has-testing-info
Focuses: Cc:

Description

How do you test and debug things related to WP_Mail with wordpress_develop?

Unless I'm missing something in the code, I think that having an optional runnable Mailhog instance could be pretty neat for testing and debugging purposes.

Maybe there are some other proposals or ideas that I would like to know, but meanwhile I will be uploading a patch with Mailhog idea.

Change History (4)

This ticket was mentioned in Slack in #core-test by sirlouen. View the logs.


5 weeks ago

This ticket was mentioned in PR #8555 on WordPress/wordpress-develop by @SirLouen.


5 weeks ago
#2

  • Keywords has-patch added

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

#3 @SirLouen
5 weeks ago

  • Keywords needs-testing has-testing-info added

Ready for testing

#4 @SergeyBiryukov
27 hours ago

  • Milestone changed from Awaiting Review to 6.9
Note: See TracTickets for help on using tickets.