The Messaging document lists several ways to learn the parts of MIME in a message, but another simple option might be to use BodyPartson MimeMessage.
To get started, let's see how the property works MimeMessage.Attachments:
public IEnumerable<MimeEntity> Attachments {
get { return BodyParts.Where (x => x.IsAttachment); }
}
As you already noted, the reason this property does not return the attachments you are looking for is because they do not Content-Disposition: attachmenthave what the property checks MimeEntity.IsAttachment.
An alternative rule may be to check the file name parameter.
var attachments = message.BodyParts.Where (x => x.ContentDisposition != null && x.ContentDisposition.FileName != null).ToList ();
Or maybe you could say that you just want all the images:
var images = message.BodyParts.OfType<MimePart> ().Where (x => x.ContentType.Matches ("image", "*")).ToList ();
, , .