Return io.Reader/io.Writer instead of reading everything
xeoncross opened this issue · 0 comments
xeoncross commented
The current code reads the full body in of every part resulting in high memory usage if the email contains big attachments or many instances are running at the same time.
It would be better to build a custom io.Writer buffer or simply return the io.Reader allowing the app to decided to io.Copy
, bytes.Buffer
, or ReadAll
as needed.