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

Feature Request: Save to directory #13

Open
pedromorgan opened this issue Dec 11, 2014 · 6 comments
Open

Feature Request: Save to directory #13

pedromorgan opened this issue Dec 11, 2014 · 6 comments

Comments

@pedromorgan
Copy link

Possibility to save messages to a directory..

eg
-storage directory -directory /home/tests/mail/

Rationale, I want to go an investigate sent messages later, and having the messages in files would help

@ian-kent ian-kent added this to the Go-MailHog v0.08 milestone Dec 11, 2014
@ian-kent ian-kent modified the milestones: Go-MailHog v0.08, Go-MailHog v0.09 Dec 21, 2014
@ian-kent
Copy link
Member

Would this be better handled using something like MongoDB?

Implementing a file based storage backend would be problematic (search, paging, etc) - though not impossible.

Would you need it as a full storage backend, or just an additional option to also spool messages to disk?

@nathankurtyka
Copy link

+1 on not requiring MongoDB. I totally see the value if it's already part of someone's stack, but I think it might be more common to write emails to disk.

It would be awesome if MailHog could persist messages to directories of .eml files, instead of memory/Mongo

@pedromorgan
Copy link
Author

Actually what I want..

Is for mailhog to sump these into a directory..

Mainly cos it would be interesting to create a mailhog reader..
And embed a parser and mailserver..
for fun...

@ian-kent
Copy link
Member

This is partially implemented in v0.2.0 - everything except search should work.

You can pass in -storage=maildir to output data to file, and use -maildir-path=/path/to/maildir to control the output directory.

It currently writes files in a very MailHog specific format - I'll eventually make this fully compatible with Maildir so its contents can be read by a mail server like Courier-IMAP

@teranshil
Copy link

teranshil commented Jan 20, 2020

Really practical feature!
Have stumbled across an issue.
I have downloaded Mailhog through homebrew. Have tried to set storage variable in varieties of ways. Like ./Mailhog -storage "maildir", ... -storage='maildir', ... -storage 'maildir'..

But nothing worked out. When I tested it by running ./Mailhog it says 'Using in-memory storage'.
The same thing happens with -maildir.

@delgurth
Copy link

@teranshil

Really practical feature!
Have stumbled across an issue.
I have downloaded Mailhog through homebrew. Have tried to set storage variable in varieties of ways. Like ./Mailhog -storage "maildir", ... -storage='maildir', ... -storage 'maildir'..

But nothing worked out. When I tested it by running ./Mailhog it says 'Using in-memory storage'.
The same thing happens with -maildir.

You missed the other flag: -maildir-path

MailHog -storage=maildir -maildir-path=/tmp/maildir
2020/01/28 15:25:56 Using maildir message storage
2020/01/28 15:25:56 Maildir path is /tmp/maildir
2020/01/28 15:25:56 [SMTP] Binding to address: 0.0.0.0:1025
[HTTP] Binding to address: 0.0.0.0:8025
2020/01/28 15:25:56 Serving under http://0.0.0.0:8025/
Creating API v1 with WebPath:
Creating API v2 with WebPath:

@tyndyll tyndyll removed this from the Go-MailHog v0.2.0 milestone Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants