[bugfix] mail extension module: support binary mail attachments

Properly handle binary attachments whose data is already encoded in base64. Check specified mime type to see if the attachment is a binary or not. Previously only text was handled properly.