[GH-ISSUE #301] [Feature request] - Multi-tenancy on single instance of Mailpit #200

Closed
opened 2026-03-15 13:09:41 +03:00 by kerem · 3 comments
Owner

Originally created by @arxeiss on GitHub (May 22, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/301

Hello,

I'm now maintaining project for organization that is educating girls in IT. We have 1 instance of testing application for each team (now 12 teams + 2 lecturers app).

So that means I have to spin up also 14 instances of Mailpit etc. It would be nice to spin up just 1 instance. And just by configuring it I would set up 14 accounts. Meaning 14 different SMTP credentials and 14 different UI accounts. When after login, each account would see only the own emails.

So I'm wondering if you would be OK with implementing (or even accepting PR with) multi-tenancy feature.
My idea was to reuse tenancy you support now. Meaning if you configure tenantID you cannot setup multi-tenancy and vice-versa.

Then if you setup multi-tenancy (new seciton in config), it would contain section for users and SMTP credentials. Then the rest of code would require minimal changes. As I would be reusing existing Authentication and existing tenant usage.

However, I need to handle that by this Saturday. So I might not be able to prepare PR now and I will end up spinning 14 instances anyway. But for future courses I might be preparing that.

Originally created by @arxeiss on GitHub (May 22, 2024). Original GitHub issue: https://github.com/axllent/mailpit/issues/301 Hello, I'm now maintaining project for organization that is educating girls in IT. We have 1 instance of testing application for each team (now 12 teams + 2 lecturers app). So that means I have to spin up also 14 instances of Mailpit etc. It would be nice to spin up just 1 instance. And just by configuring it I would set up 14 accounts. Meaning 14 different SMTP credentials and 14 different UI accounts. When after login, each account would see only the own emails. So I'm wondering if you would be OK with implementing (or even accepting PR with) multi-tenancy feature. My idea was to reuse tenancy you support now. Meaning if you configure `tenantID` you cannot setup multi-tenancy and vice-versa. Then if you setup multi-tenancy (new seciton in config), it would contain section for users and SMTP credentials. Then the rest of code would require minimal changes. As I would be reusing existing Authentication and existing tenant usage. However, I need to handle that by this Saturday. So I might not be able to prepare PR now and I will end up spinning 14 instances anyway. But for future courses I might be preparing that.
kerem 2026-03-15 13:09:41 +03:00
  • closed this issue
  • added the
    stale
    label
Author
Owner

@axllent commented on GitHub (May 22, 2024):

Hi @arxeiss. This feature request has come up a couple of times in the past, but I do not believe it is "that simple". Recently I added tenancy database support which would assist in this feature, however the complication would arise on both the frontend (web UI) as well as the SMTP as to routing & access. Mailpit was never designed to be multi-user, and I suspect that in order to make it so, a huge portion would have to be rewritten, as well as potentially break backwards-compatibility (specifically SMTP and API).

That last part is a deal-breaker - if adding multi-user support meant that changes are required in the API, then this is an absolute no-go.

I understand your point - setting up multiple instances for your use-case, but you will likely have a much easier time scripting a multi-deployment script than trying to change Mailpit. I don't want to discourage you though, as I think there are some cool features that could be gained by adding multi-user, I'm just preparing you to expect complications. I would definitely consider a PR to add this functionality, provided of course it is backwards compatible.

<!-- gh-comment-id:2125880828 --> @axllent commented on GitHub (May 22, 2024): Hi @arxeiss. This feature request has come up a couple of times in the past, but I do not believe it is "that simple". Recently I added tenancy database support which would assist in this feature, however the complication would arise on both the frontend (web UI) as well as the SMTP as to routing & access. Mailpit was never designed to be multi-user, and I suspect that in order to make it so, a huge portion would have to be rewritten, as well as potentially break backwards-compatibility (specifically SMTP and API). That last part is a deal-breaker - if adding multi-user support meant that changes are required in the API, then this is an absolute no-go. I understand your point - setting up multiple instances for your use-case, but you will likely have a much easier time scripting a multi-deployment script than trying to change Mailpit. I don't want to discourage you though, as I think there are some cool features that could be gained by adding multi-user, I'm just preparing you to expect complications. I would definitely consider a PR to add this functionality, provided of course it is backwards compatible.
Author
Owner

@github-actions[bot] commented on GitHub (May 30, 2024):

This issue has been marked as stale because it has been open for 7 days with no activity.

<!-- gh-comment-id:2138524297 --> @github-actions[bot] commented on GitHub (May 30, 2024): This issue has been marked as stale because it has been open for 7 days with no activity.
Author
Owner

@github-actions[bot] commented on GitHub (Jun 2, 2024):

This issue was closed because there has been no activity since being marked as stale.

<!-- gh-comment-id:2143661806 --> @github-actions[bot] commented on GitHub (Jun 2, 2024): This issue was closed because there has been no activity since being marked as stale.
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#200
No description provided.