The easiest way is using IMail.ExtractAttachmentsFromInnerMessages method.
It extracts all attachments from the email and from all attached messages. It returns easy to use collection of MimeData objects, that represent each attachment.
IMail mail = new MailBuilder().CreateFromEml(
imap.GetMessageByUID(uid));
ReadOnlyCollection<MimeData> attachments =
mail.ExtractAttachmentsFromInnerMessages();
foreach (MimeData mime in attachments)
{
byte[] bytes = mime.Data;
string fileName = mime.SafeFileName;
}
If you want to implement more complex processing take a look at Process emails embedded as attachments article. It describes how to traverse entire MIME tree.