-
Notifications
You must be signed in to change notification settings - Fork 123
Open
Description
Here is an example of an email that should be successfully parsed. I believe what ends up happening is that isFinalBoundary never returns true, so the epilogue, the part after the last boundary line, it treated as a part. According to RFC2046 the epilogue should be ignored.
isFinalBoundary, as the comments above the declaration say, only considered the boundary final only if the boundary is followed by whitespace. But the spec allows for non-white space characters after the final boundary line.
go-message/textproto/multipart.go
Lines 302 to 312 in b9039e0
| // isFinalBoundary reports whether line is the final boundary line | |
| // indicating that all parts are over. | |
| // It matches `^--boundary--[ \t]*(\r\n)?$` | |
| func (mr *MultipartReader) isFinalBoundary(line []byte) bool { | |
| if !bytes.HasPrefix(line, mr.dashBoundaryDash) { | |
| return false | |
| } | |
| rest := line[len(mr.dashBoundaryDash):] | |
| rest = skipLWSPChar(rest) | |
| return len(rest) == 0 || bytes.Equal(rest, mr.nl) | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels