forked from github/parsemail
fixed issue in mail RawBody
This commit is contained in:
parent
0df0eec02a
commit
a7da51d932
@ -24,9 +24,7 @@ const contentTypeTextPlain = "text/plain"
|
||||
func Parse(r io.Reader) (email Email, err error) {
|
||||
var msgbody bytes.Buffer
|
||||
msgbodycopy := io.TeeReader(r, &msgbody)
|
||||
|
||||
msgbodybytes, err := ioutil.ReadAll(msgbodycopy)
|
||||
email.RawBody = string(msgbodybytes)
|
||||
|
||||
msg, err := mail.ReadMessage(&msgbody)
|
||||
if err != nil {
|
||||
@ -37,6 +35,7 @@ func Parse(r io.Reader) (email Email, err error) {
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
email.RawBody = string(msgbodybytes)
|
||||
|
||||
contentType, params, err := parseContentType(msg.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user