foens/hpop

Media Type must be in the format type "/" subtype

Opened this issue · 1 comments

I received a DMARC report from comcast.net where they attach a file with this headers:

--=swift_v4_1446797115_ca703a3c7df531536614df116b23855b=
Content-Type: application-x-gzip; name=comcast.net![hidden].xml.gz
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename=comcast.net![hidden].xml.gz

The Exception stack is:
Parameter name: mediaType
at OpenPop.Mime.Header.HeaderFieldParser.cleanMediaType(String mediaType)
at OpenPop.Mime.Header.HeaderFieldParser.ParseContentType(String headerValue)
at OpenPop.Mime.Header.MessageHeader.ParseHeader(String headerName, String headerValue)
at OpenPop.Mime.Header.MessageHeader.ParseHeaders(NameValueCollection headers)
at OpenPop.Mime.Header.MessageHeader..ctor(NameValueCollection headers)
at OpenPop.Mime.Header.HeaderExtractor.ExtractHeadersAndBody(Byte[] fullRawMessage, MessageHeader& headers, Byte[]& body)
at OpenPop.Mime.MessagePart.ParseMultiPartBody(Byte[] rawBody)
at OpenPop.Mime.MessagePart.ParseBody(Byte[] rawBody)
at OpenPop.Mime.MessagePart..ctor(Byte[] rawBody, MessageHeader headers)
at OpenPop.Mime.Message..ctor(Byte[] rawMessageContent, Boolean parseBody)
at OpenPop.Pop3.Pop3Client.GetMessage(Int32 messageNumber)

The correct Content-Type should be application/x-gzip, but I guess whatever software comcast is using is broken.

The way that MailKit (my own mail library) handles this is that it treats invalid mime-types as application/octet-stream, perhaps OpenPOP.NET can be fixed to do the same.