-
Notifications
You must be signed in to change notification settings - Fork 497
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
Add persistence support #303
Conversation
To try the docker image with this feature :
Or by helm deployment in a kubernetes environment :
You can customize the deployment by updating default values : https://github.com/cnieg/helm-charts/blob/master/charts/maildev/values.yaml It will be great if we can include the helm chart in this repo. |
lib/mailserver.js
Outdated
if (err) { | ||
logger.error('Error during reading of the file %s', filePath) | ||
} else { | ||
var mail = JSON.parse(data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I've tried your image without much success. This line seems to be the problem. Isn't this supposed to parse the eml file (which is not a JSON)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I forgot to add some code of my fork.
2 ways to deal with this :
- Persist the state in a json file per eml
- Reload the state from all eml file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New commits to reload mails from eml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the docker image and charts : #303 (comment)
Codecov Report
@@ Coverage Diff @@
## master #303 +/- ##
==========================================
- Coverage 71.63% 67.25% -4.39%
==========================================
Files 10 10
Lines 543 571 +28
Branches 113 118 +5
==========================================
- Hits 389 384 -5
- Misses 154 187 +33 |
… we use a new date. This avoid to loose the date after reloading mail from directory
I never develop on nodejs but I can try to add some test if you want |
What do you want to do with this PR ? If you don't want to merge I understand but i will kept my own fork. |
👍 |
+1 for this feature. Can we at least add a configurable option so as to not clear the temp directory if a flag is passed so that for users who don't want it cleared can use a sort of persisted volume with docker. |
Project seems abandoned, actually. Lots of Issues and PRs and no words from the lead devs... |
Merging to implement further changes from my fork that depend on this PR. |
This PR add some new features :
Inspered by this PR #280
Can address this issues :
The last point is usefull to adresses this issues : #237 & #127 cause you can add an external rules for purging mail in directory (ie: cron find file aged more than X days, delete it & trigger reload mail)
For a preview of usage for this feature in a kubernetes environnement with helm, you can check this repo : https://github.com/cnieg/helm-charts/tree/master/charts/maildev