Get full bytes of rfc822 attachment
requaos opened this issue · comments
Neil commented
What I did:
e, err := enmime.ReadEnvelope(email)
if err != nil {
return err
}
for _, a := range e.Attachments {
if a.ContentType == "message/rfc822" ||
(strings.HasSuffix(strings.ToLower(a.FileName), ".eml") && a.ContentType == "application/octet-stream") {
err := saveAttachment(a.Content)
if err != nil {
return err
}
return nil
}
}
What I expected:
a.Content
to be the full slice of bytes of the attachment
What I got:
just the body of the attached message without the headers, boundary...
Release or branch I am using:
origin/master
Neil commented
Is there presently a way to preserve the original content of an attached rfc822 attachment?
James Hillyerd commented
This sounds like a bug, but it will be a while before I can get to it. If you have a simple/short email that reproduces the issue, attaching it here would be helpful.
Neil commented
Just coming back to this now and it appears to either have been resolved or was never an issue.
James Hillyerd commented
Cool. Probably time for me to push out a new release, been a while.