SMTP module: Add E2E testing API (search, wait, extract, stats)#334
Merged
Conversation
…stats, delete) Agent-Logs-Url: https://github.com/buggregator/server/sessions/d7c6264b-fee5-4b75-bb9f-40076f256407 Co-authored-by: butschster <773481+butschster@users.noreply.github.com>
Agent-Logs-Url: https://github.com/buggregator/server/sessions/d7c6264b-fee5-4b75-bb9f-40076f256407 Co-authored-by: butschster <773481+butschster@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add SMTP module: API for end-to-end testing
SMTP module: Add E2E testing API (search, wait, extract, stats)
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Buggregator's fake SMTP server captures emails but lacked the API surface needed for E2E test suites (Playwright, Cypress, PHPUnit, etc.) to find messages, wait for arrival, and extract links/codes without hand-rolling polling loops and HTML regex parsers.
New endpoints (
/api/smtp/)GET /api/smtp/cursorsinceto avoid stale matchesGET /api/smtp/messagesto,from,cc,subject,subject_contains,subject_regex,body_contains,since,until,project,limit,offset,orderGET /api/smtp/messages/wait408on timeout; accepts the same filters as searchGET /api/smtp/message/{uuid}/rawmessage/rfc822)GET /api/smtp/message/{uuid}/linksGET /api/smtp/message/{uuid}/codes\b\d{4,8}\b); custompatternparam;400on invalid regexDELETE /api/smtp/messages?project=GET /api/smtp/stats{count, last_received_at}— smoke-check that SMTP transport is wiredTypical E2E flow
Module changes
module.go—RegisterRoutesoverride wires all endpoints;OnEventStored+subscribe()implement the long-poll waiter (subscribe-before-check pattern eliminates the race between "no existing match" and "event just arrived").handler.go—AuthPlainnow extracts project from the SMTP AUTH username (test-run-42@smtp→ projecttest-run-42), enabling per-mailbox isolation for parallel CI workers.Reset()clears the extracted project.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
go.yaml.in/dependabot-proxy /dependabot-proxy RETURN mpile 0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet 2737�� 9e8a34caf7439976049817a4181f4a2d397/config.json ler.go -main/dist/gh-gpgsign/gh-gpgsign-linux-x86_64 --gdwarf-5 ce t -main/dist/gh-gp--no-checkout(dns block)/dependabot-proxy /dependabot-proxy ang/prometheus/prev-parse t ux-amd64/pkg/tool/linux_amd64/compile -W .test t rg/toolchain@v0.0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet . egator/go-buggre--wait t rg/toolchain@v0.filter -I /smtp/module.go om/prometheus/cl! rg/toolchain@v0.-i --gdwarf-5 s140/hkdf/cast.g/etc/ca-certificates/update.d/ l/linux_amd64/cobr-8684506c92c8 rg/toolchain@v0.-j(dns block)google.golang.org/dependabot-proxy /dependabot-proxy RETURN mpile 0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet 2737�� 9e8a34caf7439976049817a4181f4a2d397/config.json ler.go -main/dist/gh-gpgsign/gh-gpgsign-linux-x86_64 --gdwarf-5 ce t -main/dist/gh-gp--no-checkout(dns block)/dependabot-proxy /dependabot-proxy ang/prometheus/prev-parse t ux-amd64/pkg/tool/linux_amd64/compile -W .test t rg/toolchain@v0.0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet . egator/go-buggre--wait t rg/toolchain@v0.filter -I /smtp/module.go om/prometheus/cl! rg/toolchain@v0.-i --gdwarf-5 s140/hkdf/cast.g/etc/ca-certificates/update.d/ l/linux_amd64/cobr-8684506c92c8 rg/toolchain@v0.-j(dns block)gopkg.in/dependabot-proxy /dependabot-proxy RETURN mpile 0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet 2737�� 9e8a34caf7439976049817a4181f4a2d397/config.json ler.go -main/dist/gh-gpgsign/gh-gpgsign-linux-x86_64 --gdwarf-5 ce t -main/dist/gh-gp--no-checkout(dns block)/dependabot-proxy /dependabot-proxy ang/prometheus/prev-parse t ux-amd64/pkg/tool/linux_amd64/compile -W .test t rg/toolchain@v0.0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet . egator/go-buggre--wait t rg/toolchain@v0.filter -I /smtp/module.go om/prometheus/cl! rg/toolchain@v0.-i --gdwarf-5 s140/hkdf/cast.g/etc/ca-certificates/update.d/ l/linux_amd64/cobr-8684506c92c8 rg/toolchain@v0.-j(dns block)modernc.org/dependabot-proxy /dependabot-proxy RETURN mpile 0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet 2737�� 9e8a34caf7439976049817a4181f4a2d397/config.json ler.go -main/dist/gh-gpgsign/gh-gpgsign-linux-x86_64 --gdwarf-5 ce t -main/dist/gh-gp--no-checkout(dns block)/dependabot-proxy /dependabot-proxy ang/prometheus/prev-parse t ux-amd64/pkg/tool/linux_amd64/compile -W .test t rg/toolchain@v0.0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet . egator/go-buggre--wait t rg/toolchain@v0.filter -I /smtp/module.go om/prometheus/cl! rg/toolchain@v0.-i --gdwarf-5 s140/hkdf/cast.g/etc/ca-certificates/update.d/ l/linux_amd64/cobr-8684506c92c8 rg/toolchain@v0.-j(dns block)nhooyr.io/dependabot-proxy /dependabot-proxy RETURN mpile 0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet 2737�� 9e8a34caf7439976049817a4181f4a2d397/config.json ler.go -main/dist/gh-gpgsign/gh-gpgsign-linux-x86_64 --gdwarf-5 ce t -main/dist/gh-gp--no-checkout(dns block)/dependabot-proxy /dependabot-proxy ang/prometheus/prev-parse t ux-amd64/pkg/tool/linux_amd64/compile -W .test t rg/toolchain@v0.0.1-go1.26.1.linux-amd64/pkg/tool/linux_amd64/vet . egator/go-buggre--wait t rg/toolchain@v0.filter -I /smtp/module.go om/prometheus/cl! rg/toolchain@v0.-i --gdwarf-5 s140/hkdf/cast.g/etc/ca-certificates/update.d/ l/linux_amd64/cobr-8684506c92c8 rg/toolchain@v0.-j(dns block)If you need me to access, download, or install something from one of these locations, you can either: