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

Enhancement: Provide cleaner func to minimize memory #207

Open
jimidle opened this issue Aug 1, 2021 · 0 comments
Open

Enhancement: Provide cleaner func to minimize memory #207

jimidle opened this issue Aug 1, 2021 · 0 comments

Comments

@jimidle
Copy link

jimidle commented Aug 1, 2021

When using the parser as a step in a set of functions, it is sometimes necessary to serialize the envelope. it would be nice to have a minimizer function that cleaned out a few things that have been parsed and are not needed after parsing for probably a lot of applications.

Of course, it is trivial to write an external func to do this, but a builtin would just be a bit cleaner.

What I need to do is:

I save the attachment contents once they are parsed and available in the envelope parts. I then nil the Content field but retain the metadata.
I also nil out the Content field for html and text parts as they have been decoded and I don't need that Content going over the wire.

As I said, easy to do outside the package, but a func called something like Cleanup() or Minimize, with maybe an option set to ask for certain operations might be useful to others?

Release or branch I am using:

github.com/jhillyerd/enmime v0.9.0
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

2 participants