Mime Header is not being unfolded


Mime headers can be folder per RFC822. It appears the headers are not being unfolded during parsing. It is notable when receiving a file with a long file name from applications like MS Outlook. In my case I had a file name with 67 characters.

A simple fix is to replace "\r\n " with " ".in the ParseHeader function.
That is replace {Carriage Return}{Line Feed}{Space} with {Space}.
header.RawValue = this.Encoding.GetString(CreateNewBytes(new IntPtr(current), end - current));
header.RawValue = header.RawValue.Replace("\r\n ", " ");


higty wrote Jul 3, 2015 at 3:38 AM

Codeplex is unmaintained.
You can get latest version from https://github.com/higty/higlabo.

It is a spec.
RawValue represent the "raw value" of mail header.
So, it include {Carriage Return}{Line Feed}.
You can get logical value from Value property of MimeHeader object.
Does it meet your requirement?