mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 08:45:54 +03:00
[GH-ISSUE #117] Include Message-ID in MessageSummary #78
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#78
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Corvan on GitHub (May 29, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/117
Hey,
I found your project to be very valuable as a replacement for mailhog. For my development with Odoo at work, I wanted to have a tool with which I could test in integration tests if mail was actually sent. So I remembered mailhog found, it was abandoned and found this.
Because we are working with Python, I started to write an API client privately.
Now that I am at the point of writing test-helpers to be used by tests, I realised, that it would be nice to have the Message-ID included in the summary returned by the
/messages-endpoint. Background being: if I want to test if a mail has actually been sent, I would ask the/messages-endpoint, and check for the number of messages returned. But because I cannot be sure if not more Messages were sent, I would have to get all IDs of all messages (of the last time) and then request all messages by their ID to receive their Message ID. Or could I do this with the/search-endpoint searching for the respective Message-ID?I can get the Message-ID from a Message, that Odoo saved in its database, so I believe I would be able to write a test for Odoo, which triggers creating & sending a Message, and afterwards checking if the Message actually has been sent to mailpit.
I attempted to write a Pull Request #116, but I am not a Go developer, and I am not sure, if I found all places that would have to be changed or if I did it correctly.
Thank you for your good work!
Lars
@axllent commented on GitHub (May 29, 2023):
Thanks @Corvan for raising this as well as the PR, I appreciate it. I'm really busy right now, but I will definitely look into this within the next couple of days ... just letting you know so you don't think I'm ignoring you!
@Corvan commented on GitHub (May 29, 2023):
No hurries, thx for letting me know!
@axllent commented on GitHub (May 30, 2023):
Great attempt, especially since you're not a Go developer :) I had to make a few corrections, and added the MessageID to the API search response and event websockets, but you were mostly there.
Actually you can (I realise now this is still undocumented) - you can actually search for
message-id:<insert-id-here>, eg:message-id:122342808.1152584913901.JavaMail.j2ee@akcux155. This assumes you know the Message-ID of course, which based on your comment you already do. Either way though, message IDs are now included in the other API responses.I've merged it in (plus those changes) and release this in v1.6.12. Thanks again for the help. Please let me know if this resolves your issue?
@Corvan commented on GitHub (May 30, 2023):
Wow, that was quick!
Thank you very much, it works now
github.com/Corvan/mailpit-api-client@b8ed5c5440But I think we forgot to include it here: https://github.com/axllent/mailpit/blob/develop/docs/apiv1/Messages.md . Would you want me to add it? In a new PR?
I am testing the API in integration tests via docker in my project as well. As soon as I have the time to transfer all the testing I am doing locally via
invokeanddocker-composewith containers into GitHub-Actions, maybe you'll get the possibility to adapt this for Go, if you like to ;-)@axllent commented on GitHub (May 30, 2023):
Thanks, I have just updated those API docs too. I think there's potentially a few other things missing, however since I integrated swagger documentation (eg:
http://localhost:8025/api/v1/) I haven't give that much love.I'd be interested to see how you end up integrating API testing in GitHub Actions. I'm marking this as closed as it appears to be. Thanks again for the feedback and pull request!