Browse Source

dont report notMime error unless there are 0 parts

flashmob 6 years ago
parent
commit
ff26a3b69f
1 changed files with 4 additions and 2 deletions
  1. 4 2
      mail/mime/mime.go

+ 4 - 2
mail/mime/mime.go

@@ -824,8 +824,10 @@ func (p *Parser) mime(parent *Part, depth string) (err error) {
 					break
 					break
 				}
 				}
 			}
 			}
-			part.EndingPosBody = p.msgPos
-			err = NotMime
+			if len(p.Parts) == 0 {
+				part.EndingPosBody = p.msgPos
+				err = NotMime
+			}
 			return
 			return
 		}
 		}
 		// after we return from the lower branches (if there were any)
 		// after we return from the lower branches (if there were any)