Skip to content

Conversation

@Adityakk9031
Copy link

Linked issue: #4451

Summary

Disable Mailpit reverse DNS lookups in the local dev stack to avoid ~8–10s SMTP delays observed on some systems. This change adds the environment variable MP_SMTP_DISABLE_RDNS=true to the Mailpit / Inbucket container configuration in the Supabase CLI so Mailpit will not perform reverse DNS lookups on incoming SMTP connections.

Changes

  • Modify internal/start/start.go (Mailpit / Inbucket container container.Config) to include:
Env: []string{
    "MP_SMTP_DISABLE_RDNS=true",
},

(Only the Mailpit/Inbucket container config needs this change.)

Motivation & Context

See issue: #4451

On affected systems Mailpit performs a reverse DNS lookup for clients which can fail due to Docker DNS behaviour ("bad rdata") and results in a ~10 second timeout on every SMTP connection. Disabling RDNS is safe for local development, has no negative side effects, and eliminates the delay which blocks tests and slows developer workflows.

How to test

  1. Build or run the CLI locally and start the local stack:

    supabase start
  2. Ensure Mailpit/Inbucket is running (default SMTP port used by the project).

  3. From the host, open a simple SMTP connection and observe the greeting latency:

    time telnet localhost 54325
    # Expect immediate (<< 1s) greeting instead of ~8-10s delay
  4. Programmatic test (e.g. Node.js + nodemailer) — send an email and verify the operation completes quickly.

  5. Run existing test-suite that relies on SMTP (e.g. Playwright flows) to confirm tests no longer incur the delay.

Checklist

  • Change is minimal and limited to the Mailpit/Inbucket container config.
  • Verified that disabling RDNS prevents the ~8–10s delay locally.
  • Add/update unit/integration tests (if applicable).
  • Add note to changelog/release notes (optional).
  • Add documentation entry (if desired) mentioning RDNS is disabled in local dev stack.

Release Notes

fix(mailpit): disable reverse DNS lookups in local Mailpit container to eliminate SMTP delays on some systems (fixes #4451).

@Adityakk9031 Adityakk9031 requested a review from a team as a code owner November 12, 2025 20:27
@coveralls
Copy link

Pull Request Test Coverage Report for Build 19310899090

Details

  • 6 of 8 (75.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 54.423%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/start/start.go 6 8 75.0%
Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 19289041177: -0.01%
Covered Lines: 6362
Relevant Lines: 11690

💛 - Coveralls

@Adityakk9031
Copy link
Author

@sweatybridge please check this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mailpit SMTP server has 8-10 second delay on email send due to reverse DNS lookup timeouts on some systems

2 participants