Skip to content

feat: save email contents to local files#47

Draft
guilhem-martin wants to merge 15 commits intophires:masterfrom
guilhem-martin:feat/contenttolocalfiles
Draft

feat: save email contents to local files#47
guilhem-martin wants to merge 15 commits intophires:masterfrom
guilhem-martin:feat/contenttolocalfiles

Conversation

@guilhem-martin
Copy link

Proposition of a new processor that save the email as local files - one per mime part - with extensions.

@phires
Copy link
Owner

phires commented Jul 18, 2024

Hi, thank you a lot for your PR and effort!
I'm currently on the road, I'll have a detailed look into it once I return

@phires phires self-assigned this Jul 18, 2024
@phires phires added the enhancement New feature or request label Jul 18, 2024
@phires
Copy link
Owner

phires commented Jul 18, 2024

Maybe we can move some of the ParseContent func to another file, just to have it somewhat cleaner, and also to be able to create versions for other OSes, as with the current code it would fail on Windows.
Also the charset parsing looks strange, there has to be a better way. From just having done a quick search there seems to be modules to do the parsing, e.g. https://github.com/jhillyerd/enmime
It might be worth to look into that before we reinvent the wheel ;)

@guilhem-martin
Copy link
Author

Thanks for your feedbacks - I'm going to propose evolutions based on your suggestion - and keep you posted.

For information, I manually test with a bunch of smtp messages that I stored here: https://github.com/guilhem-martin/go-guerrilla-wiki/blob/docs/manual_tests/Manual-testing.md

A question about the configuration of the content parser that has currently one parameter - the path where to store the files - should I move the configuration to the goguerrilla.conf.json? If yes, how can I retrieve the Config object to get the path?

@guilhem-martin guilhem-martin marked this pull request as draft July 19, 2024 18:29
@guilhem-martin
Copy link
Author

@phires so I've added the use of enmime library to take care of the parsing and decoding of the mime parts. Let me know if this looks good to you for that part of the PR, thanks!

@phires
Copy link
Owner

phires commented Sep 24, 2024

Sorry, I was offline a while. I'll have a look into it as soon I find some time!

@guilhem-martin
Copy link
Author

No problem. Let me know if you think if this feature can be of interest .
I've used it for a personal use case - so thanks anyway for maintaining this project.

I realize that I added the configuration to the generic configuration file whereas the documentation states to have dedicated configuration for a given processor - I'll update it.

@COD3HUNT3R
Copy link

Isn't there https://github.com/flashmob/maildir-processor ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants