mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 08:45:54 +03:00
[GH-ISSUE #237] Feature request: grouping messages by various criteria (sender, originating server, etc) #154
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#154
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 @wesyah234 on GitHub (Jan 16, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/237
The use case is this: our development team shares a single instance of mailpit, but we each test different apps that are sending messages in, and when one developer goes in to view their messages, they'd rather not see messages from the other developer's testing efforts. Sometimes, if only one developer is needing to test at a given time, they can check with the others and then delete all the older messages, giving themselves a clean slate, but if 2 people are testing at the same time this is not possible.
The idea would be to have a filter on the left side, that would dynamically group messages by different criteria, like sender email address, originating server, subject substring or other things that might be available in the headers of each mail, which would allow dev teams to partition their view of the inbox. This would also be part of the url so one could bookmark their unique view to remove the other developer's messages.
Thanks!
@axllent commented on GitHub (Jan 16, 2024):
Hi @wesyah234 . This sounds to me like something that can already be handled by existing tagging. You would either need to provide an
X-Tagsemail header to auto-tag, or alternatively start your Mailpit instance with word/phrase matches defined.Alternatively, you could just search for something specific (ie: the hostname) and bookmark the search URL.
Does this do what you need?
@wesyah234 commented on GitHub (Jan 16, 2024):
Wow, that's a cool feature, and I think it will definitely help us. I'll play with it a bit. I'll have to get my sysadmin to allow me to start and stop the instance to test things out with that --tag parameter but I think it might be useful for us.
Just trying out the basic search and then bookmark option. I had a few issues:
Reason being: certain developers might have email coming from a certain server, identified by the Received: header, and this would be handy (along with OR capability) to be able to craft a search string specific for the messages that developer is interested in.
@axllent commented on GitHub (Jan 17, 2024):
Mailpit uses SQLite for storage, and whilst SQLite is perfect for this use (small, embedded and relatively fast), it's not advanced like some Gmail/Google database backend, so there are some limits.
"search this") and exclude (!"exclude this"or-"exclude this"). You can however specify tags multiple times in the Mailpit startup flags (--tag 'host1="1.2.3.4" host1="2.3.4.5"') to handle your "OR" situation as you would then just filter by that tag (this is the solution you are probably after).to:etc) also includes Reply-To and Return-Path, but not hostnames etcThe "word/phrase matches" used in
--tagis a 1:1 match on the entire message including headers, so provided you know the hostname then you can tag it as it arrives, and I believe this is the solution you are after.There is one "catch" you should be aware of though - whilst Mailpit does live load new messages (websockets) as they arrive, this does not apply to filtered views, only the inbox itself. Searches are (in comparison to the inbox) very heavy and slow, so if the server and the browser had to calculate whether each arriving message matches a current search it would cause all sorts of issues. The search needs to be re-run to load new matching messages, or the tag clicked again (tags are effectively just searches, but are much faster to look up than a regular search). I may at some point add live loading to tag views, however I can foresee all kinds of complications and performance issues, so I don't think this will happen any time soon, it at all.
I hope this helps....
@wesyah234 commented on GitHub (Jan 17, 2024):
Thank you very much for the detailed explanation of how this all works!
The live loading of filtered views would be really nice but we can deal with hitting refresh on the browser.
Being able to search on any header would be nice as well but we can look at using --tag for this.
OR searching would also be nice in the UI but we can also look at using --tag for this.
Thanks again for the help.
@wesyah234 commented on GitHub (Jan 17, 2024):
One more idea, maybe when you perform a search, it shows up on the left side like the tags do when you apply a tag. This would avoid the need to bookmark a search and be more consistent with the tag behavior.
@axllent commented on GitHub (Jan 17, 2024):
I appreciate the ideas, but I believe this would be counterintuitive and not logical to the end user. Filtering by a tag is actually just the same as searching, except the tag is highlighted (active) in the side nav. So if I was to search for a tag and a particular word at the same time, with your logic both a tag would be highlighted as well as something else (eg "search results") which would only appear when searching.
I chose to follow the same UI logic as Gmail, and try to keep the UI as simple as possible.
To achieve what you are after (effectively a refresh of a search), you can just submit the search again as it is already filled in with what you are searching for.
@wesyah234 commented on GitHub (Jan 18, 2024):
I'm just thinking of something like below. Just like every tag you add becomes a clickable quick action on the left, it would be helpful for every search you perform (maybe not "tag" based searches) also becomes a clickable quick action on the left.
@axllent commented on GitHub (Jan 20, 2024):
Thank for the suggestion, but I do not think this is a feasible/good idea. The moment you start doing custom searches the search values can get very long, and there will be potentially a lot of them. This, together with the fact that one ultimately does a lot of searching without realising it, sometimes in combination with tags, I think it will clutter the UI for very little benefit.
What problem exactly are you trying to solve with your suggestion?
@github-actions[bot] commented on GitHub (Feb 4, 2024):
This issue is stale because it has been open for 14 days with no activity.