Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save Emails in a DB #44

Closed
jumoog opened this issue Dec 29, 2014 · 17 comments
Closed

Save Emails in a DB #44

jumoog opened this issue Dec 29, 2014 · 17 comments
Labels

Comments

@jumoog
Copy link

jumoog commented Dec 29, 2014

It should be possible to save emails.

I want use MailDev for my Website as Email Server

@djfarrelly
Copy link
Member

Thanks for the idea @jumoog! MailDev has never preserved state before and I think it might be too drastic a change if that was added to the core, especially something as specific as Mongo. I had thought about adding something like sqlite a while back, but since it's geared more towards development, I thought it would be better to keep it a bit simpler.

I would be open to the idea of creating a way to accept different storage backends which would be published independently on NPM (similar to how browserify has transforms). They could be passed via options. I'm not quite sure how to do this right away, but here's how I could see it working:

$ maildev --plugin maildev-mongo

Or

$ maildev --store mongo
$ maildev --store sqlite

As a side note, are you using MailDev on your own server for development purposes, or to act as your own email client? If you're using it for real world email, I would suggest maybe using something like Haraka?

Let me know what you think!

@jumoog
Copy link
Author

jumoog commented Dec 29, 2014

Haraka is to complex .. MailDev is easy to use and come with a nice gui

mongodb is perfect because we getting the email as json object and mongodb works with json

@jumoog jumoog changed the title Save Emails in a DB like MongoDB Save Emails in a DB Dec 29, 2014
@djfarrelly
Copy link
Member

I'll try to think about a plugin/storage implementation, but I might not have the time right now to hack on this feature, sorry. Currently #30 is the highest priority task for the project. If you need something faster, I would recommend forking the project and trying using something like Mongoose.

@pkat
Copy link

pkat commented Jun 4, 2015

I agree that maildev is geared toward development, however it would be convenient to have some sort of simple persistence, when you can't keep maildev always running and still want to view or compare previous emails. Something like Redis may be really easy to implement for fast and simple storage.

@djfarrelly
Copy link
Member

@pkat thanks for your thoughts! Adding a Redis adapter into the main project might lead to the desire to add other adapters like Memcached, SQLite, Mongo, etc. I'm totally open the idea of some persistance options, but maybe in the form of a plugin. Perhaps there could be some usage like:

$ maildev --storage=maildev-redis
$ maildev --storage=/path/to/custom-module

Which would use a compatible storage module either installed via npm or potentially something custom written that's API-compatible. What do you think?

@pkat
Copy link

pkat commented Jun 5, 2015

Yeah that makes sense. Going the adapter router would keep things more modular and lightweight and allow for any number of data stores. Reminds me of Nodemailer's concept of transport method plugins.

@dlitty
Copy link

dlitty commented Oct 17, 2016

I too would like to see some kind of persistence; not because I want to keep them long term, but rather when developing and testing we need to be able refer to emails across process shutdowns / server reboots. It can problematic to run a test on a system that generates email, make a change, then run it again - hoping to compare the results between the emails - if the process or server has shut down in the mean time.

Even just writing them to files in a path other than /tmp would be very useful.

@donut87
Copy link
Contributor

donut87 commented Oct 17, 2016

I kind of already explored that option
https://github.com/donut87/MailDev/tree/persistMails

I stopped using this tool so I did not persue this branch any further. But recall that persisting in temp files was not that hard.

@dlitty
Copy link

dlitty commented Oct 18, 2016

@donut87 - Did you stop using it because you no longer needed it, or because you changed to another tool?

@donut87
Copy link
Contributor

donut87 commented Oct 18, 2016

We did not switch to another tool. I would not say we did not need it, but we changed the way we send mails and did not reimplement this.

@joshuaadickerson
Copy link

I like this idea for development. I don't daemonize my Docker containers when I'm developing so I can just kill and restart them quickly. I do all of them at once so there's no links or anything leftover. That means I kill my maildev container.

@mkweick
Copy link

mkweick commented May 24, 2018

Any plans to include this feature? I too would like to see some kind of persistence with emails after service restarts.

@oktapodia
Copy link
Contributor

Sorry it's been a long time ago, we will look into it

@atapatel
Copy link

+1

@AmauryOrtega
Copy link

Looking forward to this 🔥

@ghost
Copy link

ghost commented Oct 28, 2020

+1

1 similar comment
@Phlegethonyarre
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests