Skip to content

Commit

Permalink
Modified TnefPart.ConvertToMessage() to promote lone multipart/mixed …
Browse files Browse the repository at this point in the history
…parts to the message body

Fixes issue #789
  • Loading branch information
jstedfast committed May 19, 2022
1 parent 1fac7d4 commit 3c04ff7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions MimeKit/Tnef/TnefPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,12 @@ static MimeMessage ExtractTnefMessage (TnefReader reader)
message.Dispose ();
throw;
}

if (attachments.Count == 1) {
message.Body = attachments[0];
attachments.Clear (false);
attachments.Dispose ();
}
} else {
message.Body = body;
}
Expand Down Expand Up @@ -768,9 +774,8 @@ public MimeMessage ConvertToMessage ()
codepage = 0;
}

using (var reader = new TnefReader (Content.Open (), codepage, TnefComplianceMode.Loose)) {
using (var reader = new TnefReader (Content.Open (), codepage, TnefComplianceMode.Loose))
return ExtractTnefMessage (reader);
}
}

/// <summary>
Expand Down

0 comments on commit 3c04ff7

Please sign in to comment.