[GH-ISSUE #104] mailpit as a proxy #68

Closed
opened 2026-03-15 12:22:49 +03:00 by kerem · 7 comments
Owner

Originally created by @renannprado on GitHub (May 3, 2023).
Original GitHub issue: https://github.com/axllent/mailpit/issues/104

We rely fully on mailhog (not for long) as our mock in lower environments.
However, we also run tests with a real SMTP server from time to time.

We're soon replacing mailhog with mailpit and I would like to know if there's a feature where mailpit acts like a proxy, meaning that it would take the e-mail, record, store it, etc; and pass over to the underlying (real) SMTP server. So that then we can see the e-mail even when we don't have access to the recipient's e-mail box.

Do we have such a feature?

Originally created by @renannprado on GitHub (May 3, 2023). Original GitHub issue: https://github.com/axllent/mailpit/issues/104 We rely fully on mailhog (not for long) as our mock in lower environments. However, we also run tests with a real SMTP server from time to time. We're soon replacing mailhog with mailpit and I would like to know if there's a feature where mailpit acts like a **proxy**, meaning that it would take the e-mail, record, store it, etc; and pass over to the underlying (real) SMTP server. So that then we can see the e-mail even when we don't have access to the recipient's e-mail box. Do we have such a feature?
kerem closed this issue 2026-03-15 12:22:54 +03:00
Author
Owner

@tonyswu commented on GitHub (May 3, 2023):

There was another feature request similar to this: https://github.com/axllent/mailpit/issues/29. I haven't gotten around to test it myself, but like yourself we'll be phasing out mailhog pretty soon.

<!-- gh-comment-id:1533374053 --> @tonyswu commented on GitHub (May 3, 2023): There was another feature request similar to this: https://github.com/axllent/mailpit/issues/29. I haven't gotten around to test it myself, but like yourself we'll be phasing out mailhog pretty soon.
Author
Owner

@axllent commented on GitHub (May 3, 2023):

I'd say 29 was a request for the exact same thing - you want Mailpit to receive an email, store a copy, and automatically send/forward that email on to another SMTP server. This functionality was added recently and is documented on https://github.com/axllent/mailpit/wiki/SMTP-relay

Please let me know if this is what you were after?

<!-- gh-comment-id:1533644906 --> @axllent commented on GitHub (May 3, 2023): I'd say 29 was a request for the exact same thing - you want Mailpit to receive an email, store a copy, and automatically send/forward that email on to another SMTP server. This functionality was added recently and is documented on https://github.com/axllent/mailpit/wiki/SMTP-relay Please let me know if this is what you were after?
Author
Owner

@renannprado commented on GitHub (May 5, 2023):

I'd say 29 was a request for the exact same thing - you want Mailpit to receive an email, store a copy, and automatically send/forward that email on to another SMTP server. This functionality was added recently and is documented on https://github.com/axllent/mailpit/wiki/SMTP-relay

Please let me know if this is what you were after?

Amazing! Thanks for the reply.

In this case, I'm closing this issue until I get the change to try it out.

<!-- gh-comment-id:1535861092 --> @renannprado commented on GitHub (May 5, 2023): > I'd say 29 was a request for the exact same thing - you want Mailpit to receive an email, store a copy, and automatically send/forward that email on to another SMTP server. This functionality was added recently and is documented on https://github.com/axllent/mailpit/wiki/SMTP-relay > > Please let me know if this is what you were after? Amazing! Thanks for the reply. In this case, I'm closing this issue until I get the change to try it out.
Author
Owner

@renannprado commented on GitHub (Jun 10, 2023):

FYI I've tried out and it works like a charm 😄 .

<!-- gh-comment-id:1585814139 --> @renannprado commented on GitHub (Jun 10, 2023): FYI I've tried out and it works like a charm 😄 .
Author
Owner

@Yahyaali1 commented on GitHub (Jun 19, 2023):

I went over the wiki. Can anyone of you please share a sample yml file for configuration of this proxy ?

<!-- gh-comment-id:1596667932 --> @Yahyaali1 commented on GitHub (Jun 19, 2023): I went over the wiki. Can anyone of you please share a sample yml file for configuration of this proxy ?
Author
Owner

@axllent commented on GitHub (Jun 19, 2023):

@Yahyaali1 I assume by proxy you mean that Mailpit automatically relays all messages via a preconfigured SMTP server? If so, first ensure your configuration is set up correctly (docs), and when Mailpit is running you are able to "release" messages via the web UI. Assuming that is working (your SMTP server accepts the messages), you can add the --smtp-relay-all flag to your Mailpit startup options (or MP_SMTP_RELAY_ALL=true to the environment, depending on how you start Mailpit) and it should work.

<!-- gh-comment-id:1596751635 --> @axllent commented on GitHub (Jun 19, 2023): @Yahyaali1 I assume by proxy you mean that Mailpit automatically relays all messages via a preconfigured SMTP server? If so, first ensure your configuration is set up correctly ([docs](https://github.com/axllent/mailpit/wiki/SMTP-relay)), and when Mailpit is running you are able to "release" messages via the web UI. Assuming that is working (your SMTP server accepts the messages), you can add the `--smtp-relay-all` flag to your Mailpit startup options (or `MP_SMTP_RELAY_ALL=true` to the environment, depending on how you start Mailpit) and it should work.
Author
Owner

@Yahyaali1 commented on GitHub (Jun 20, 2023):

Thank you @axllent.

<!-- gh-comment-id:1598422652 --> @Yahyaali1 commented on GitHub (Jun 20, 2023): Thank you @axllent.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#68
No description provided.