Add error handling for unknown content types in eml.go

The update adds a case to the switch clause in eml.go for properly handling unknown content types. An error will now be returned when the media type of the body to be parsed is not recognized, increasing the robustness of the system.
This commit is contained in:
Winni Neessen 2024-06-24 13:41:48 +02:00
parent 4c88dce2a8
commit 70c9387003
Signed by: wneessen
GPG key ID: 385AC9889632126E

1
eml.go
View file

@ -195,6 +195,7 @@ func parseEMLBodyParts(parsedMsg *netmail.Message, bodybuf *bytes.Buffer, msg *M
return fmt.Errorf("failed to parse multipart body: %w", err) return fmt.Errorf("failed to parse multipart body: %w", err)
} }
default: default:
return fmt.Errorf("failed to parse body, unknown content type: %s", mediatype)
} }
return nil return nil
} }