mailhog / MailHog

Web and API based SMTP testing
MIT License
13.88k stars 1.06k forks source link

Multi (filtered) mailbox / Smart folders support #152

Open fkrauthan opened 7 years ago

fkrauthan commented 7 years ago

I was wondering how hard would it be to add support for multiple mailboxes based on filters? Kinda like grouping messages together by filter. Use case could be a full dev team using MailHog for mail testing while each tester sets up filter kinda like:

All emails starting with "fkrauthan-.*" should go to MailBox "fkrauthan"

Now the UI would not just show Inbox which could be all emails combined but also a second item called "fkrauthan" that just contains messages matching my filter. This would allow finding relevant emails way faster in big development teams.

And to my knowledge that feature no one (not even the paid services) offer at the moment.

Lewiscowles1986 commented 7 years ago

The filtering logic is implemented on the client generally. I'm not sure there is a way to send an email to a specific folder without client rules to move the message. AFAIK everything goes via inbox.

fkrauthan commented 7 years ago

Well but this system contains a client^^ Thats why I opened this request. It is not a mailserver it is a mail testing tool that can implement something like this.

mkrsn commented 7 years ago

@fkrauthan is right. MailHog doesn't offer a IMAP4 / POP3 Service - it just offers a Web-based API and is therefore the Client.

The Filter logic is not generally implemented on the Client-side... Several MDAs (like Procmail or Maildrop etc...) offers this feature server-sided!

bessie555 commented 7 years ago

This should be possible by adding logic to the web ui, but this will then only apply to one user. Any other user using the same instance will not have access to the filters. In other words each user has to temporary set it up as they want it.

As a basic attempt we could just add basic Angular filters - maybe as tabs - or maybe even just a text filter at the top of the inbox. This would be very useful when you want to delete only specific emails.

fkrauthan commented 7 years ago

I would be already happy with some basic filters that you can quickly switch in between:

Obviously the ultimate solution would be to have filters that can be stored on the server similar to if you search for emails with thunderbird (being able to filter by headers, subject, content, recipient, sender, etc).

QuingKhaos commented 6 years ago

That's a nice idea here. Maybe you could store those filters/mailbox configs like you store outgoing smtp servers on disk and supply them on startup. So on a shared mailhog instance you could start with a default mailbox filtering/grouping by recipient for example :)

blaggacao commented 6 years ago

@yelizariev

mputilin commented 5 years ago

+1

allangood commented 5 years ago

Seems to be duplicated by #173

quorak commented 3 years ago

Maybe we could add parameters to the url that uses the search functionality. This could have dual-use effect and wont conflict with the principal of the project. e.g.: mailhog.local?query=from:test@user.de