Giter Club home page Giter Club logo

Comments (17)

djfarrelly avatar djfarrelly commented on May 13, 2024

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!

from maildev.

jumoog avatar jumoog commented on May 13, 2024

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

from maildev.

djfarrelly avatar djfarrelly commented on May 13, 2024

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.

from maildev.

pkat avatar pkat commented on May 13, 2024

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.

from maildev.

djfarrelly avatar djfarrelly commented on May 13, 2024

@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?

from maildev.

pkat avatar pkat commented on May 13, 2024

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.

from maildev.

dlitty avatar dlitty commented on May 13, 2024

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.

from maildev.

donut87 avatar donut87 commented on May 13, 2024

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.

from maildev.

dlitty avatar dlitty commented on May 13, 2024

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

from maildev.

donut87 avatar donut87 commented on May 13, 2024

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.

from maildev.

joshuaadickerson avatar joshuaadickerson commented on May 13, 2024

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.

from maildev.

mkweick avatar mkweick commented on May 13, 2024

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

from maildev.

oktapodia avatar oktapodia commented on May 13, 2024

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

from maildev.

atapatel avatar atapatel commented on May 13, 2024

+1

from maildev.

AmauryOrtega avatar AmauryOrtega commented on May 13, 2024

Looking forward to this 🔥

from maildev.

 avatar commented on May 13, 2024

+1

from maildev.

Phlegethonyarre avatar Phlegethonyarre commented on May 13, 2024

+1

from maildev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.