{"id":29422109,"url":"https://github.com/kmulvey/mailhole","last_synced_at":"2026-05-19T09:11:35.748Z","repository":{"id":304238399,"uuid":"1017456414","full_name":"kmulvey/mailhole","owner":"kmulvey","description":"A mock SMTP server and REST API to capture and validate emails sent by your application.","archived":false,"fork":false,"pushed_at":"2025-07-11T20:49:52.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-11T21:30:48.833Z","etag":null,"topics":["cypress","playwright","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kmulvey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-10T15:00:34.000Z","updated_at":"2025-07-11T20:51:23.000Z","dependencies_parsed_at":"2025-07-11T21:40:58.687Z","dependency_job_id":null,"html_url":"https://github.com/kmulvey/mailhole","commit_stats":null,"previous_names":["kmulvey/mailhole"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/kmulvey/mailhole","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmulvey%2Fmailhole","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmulvey%2Fmailhole/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmulvey%2Fmailhole/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmulvey%2Fmailhole/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kmulvey","download_url":"https://codeload.github.com/kmulvey/mailhole/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kmulvey%2Fmailhole/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264935143,"owners_count":23685492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypress","playwright","testing"],"created_at":"2025-07-12T04:01:51.462Z","updated_at":"2026-05-19T09:11:30.699Z","avatar_url":"https://github.com/kmulvey.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mailhole\nA mock SMTP server and REST API to capture and validate emails sent by your application. \n\n## REST API\n| Method | Path                                         | Description                        |\n|--------|----------------------------------------------|------------------------------------|\n| GET    | `/emails/:recipient/messages`                | List all messages for recipient    |\n| GET    | `/emails/:recipient/messages/:which`         | Get a specific message (by index, \"first\", or \"last\") |\n| GET    | `/emails/:recipient/stream`                  | WebSocket stream for new messages  |\n\n## Database Setup\n\n1. **Start postgres and mailhole**\n   ```sh\n   docker compose up --build\n2. **Install Atlas**\n   [Install Atlas](https://atlasgo.io/getting-started/install) or run:\n   ```sh\n   curl -sSf https://atlasgo.sh | sh\n3. **Create the database**\n   ```sh\n   psql -U postgres -c 'CREATE DATABASE mailhole;'\n4. **Apply migrations**\n   ```sh\n   atlas migrate apply --dir file://db/migrations --url postgres://mailhole:mailhole@localhost:5432/mailhole?sslmode=disable\n5. **(Optional) Baseline an existing database**\n   ```sh\n   atlas migrate apply --dir file://db/migrations --url postgres://mailhole:mailhole@localhost:5432/mailhole?sslmode=disable --baseline 20250709231344\n\n## Try it\n\n1. **In a different terminal, start the websocket**\n   [Install wscat](https://github.com/websockets/wscat) or run:\n   ```sh\n   wscat -c ws://localhost:8080/emails/kevin@example.com/stream\n2. **In a different terminal, send an email**\n   ```sh\n    curl -s \"smtp://localhost:2525\"   --mail-from \"verify@example.com\"   --mail-rcpt \"kevin@example.com\"   --upload-file testdata/email.txt\n3. **Retrieve the last email to that address**\n   ```sh\n    curl -s \"http://localhost:8080/emails/kevin@example.com/messages/last\" | jq\n    {\n      \"id\": 307,\n      \"sender\": \"verify@example.com\",\n      \"recipient\": \"kevin@example.com\",\n      \"subject\": \"PaperlessPost Verification email\",\n      \"body\": \"Please click here:\\nhttps://example.com\\nhttps://example.com/wedding\\nhttps://example.com/pricing\",\n      \"links\": [\n        \"https://example.com\",\n        \"https://example.com/wedding\",\n        \"https://example.com/pricing\"\n      ],\n      \"received_at\": \"2025-07-11T19:57:33.460239Z\"\n    }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmulvey%2Fmailhole","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkmulvey%2Fmailhole","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkmulvey%2Fmailhole/lists"}