mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #573] Bind to multi IP / interfaces #369
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#369
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 @sdrakey on GitHub (Oct 4, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/573
Hi,
I have a case where I am simulating multiple smtp relay IP in a dev environment. Some of the IPs are from legacy servers etc. I have some applications that use old names or dns hostnames or IPs.
Currently I just have the server where mailpit is installed having multiple IP on the same interface. However so that I can't start to investigate which application are sending mail to the different address I would like to add additional interface to the server and also only bind mailpit to particular IPs, instead of all IPs
I would also like to be able to tag messages based on the DNS /IP address that the application used.
Are any of these goals possible?
By the way, the webgui is amazing.
Thanks for all your hard work on it.
@axllent commented on GitHub (Oct 4, 2025):
Hi @sdrakey. As you have noted, Mailpit can either listen on all interfaces, or a specific one - I am not actually aware of any application which has the ability to listen on a specific subset of multiple interfaces.
The only way (I can think) of achieving this would be to run multiple (separate) instances of Mailpit - one for each interface. The downside with this would be that every instance is a complete stand-alone application, web UI & database. Technically these separate instances of Mailpit could share the same rqlite database, however the web UI for each would require a manual refresh in order to see new messages received via any of the other Mailpit instances (it's a possibility however).
As for tagging - using the multi-Mailpit / rqlite approach, you configure each Mailpit instance to auto-tag received messages with a meaningful tag based on anything in the headers (remote IP address of the connecting client?).
It's not ideal, I know, but this is about the closest solution that I can think of. Not sure if this is helpful?
@sdrakey commented on GitHub (Oct 4, 2025):
Thanks for the reply.
I came to the same conclusion, I am thinking of using multiple instances of mailpit. One master instance for looking at the messages in the gui and the other instances just doing smtp forwarding to the main instance.
Is it possible to set the forwarding instances to be headless and not cache any messages?
Presume the main instance would then see the forwarding instances in the email headers and I can make the main auto tag based on the forwarding instances IP address.
What do you think?
Cheers
@axllent commented on GitHub (Oct 4, 2025):
That's actually not a bad idea ~ run multiple instances which then auto-forward to one central one. I'm not sure how you best preserve the original message as forwarding adds headers etc, but you could use the plus-addressing to tag messages in your auto-forward setup. This way the central Mailpit server knows what to tag messages as.
As for "not cache any messages" - I would just run the individual "interface instances" (which are set to forward) with no set database (meaning it's stored temporarily), and optionally set a
--max-age 1h(to keep for 1 hour), and/or--max 1(keep one message).@github-actions[bot] commented on GitHub (Oct 12, 2025):
This issue has been marked as stale because it has been open for 7 days with no activity.
@github-actions[bot] commented on GitHub (Oct 16, 2025):
This issue was closed because there has been no activity since being marked as stale.