Mail.app – Save Message with Attachments as .eml or .msg

emailimapmail.app

Is it possible to save a message from an IMAP server as an .eml or .msg like I can in Gmail or Thunderbird? Currently when saving emails using File > Save Raw Message Source the option to save attachments is greyed out and only available when saving as a rich or plain text file.

Edit: I'll also add that, for whatever reason, the messages I'm looking to save are not viewable when connecting to this server from Outlook or Thunderbird. The folder appears blank on those systems and I can only view these messages in Apple Mail.

Best Answer

Yes, it is possible to save a message in EML format (called Raw Message Source by Mal.app) with attachments.

In fact, that's the default behavior when saving a message as an EML file by selecting File>Raw Message Source, or when dragging and dropping a message from Mail.app to the Finder. (Tested on macOS High Sierra.)

As you say, the option to save attachments is grayed out, but the attachment is included anyway (that seems to be a GUI glitch). After you save the message, you can double click it and attachments will be available. The only requirement is that the attachment has been downloaded.

Note that if you preview the EML file with Quick Look, the attachment may be shown with a question mark picture:

enter image description here

but the attachment is still there.

If you are interesed in the internals of the EML file, the attachment is included in base64 format, a binary-to-text encoding that looks like this (if you open the EML file with a text editor):

--Apple-Mail=_3512B54A-1A55-4008-A3CA-1DBA66D2D37C
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
    charset=us-ascii

Test message.

--Apple-Mail=_3512B54A-1A55-4008-A3CA-1DBA66D2D37C
Content-Disposition: attachment;
    filename=book-hudson.epub
Content-Type: application/epub+zip;
    x-unix-mode=0644;
    name="book-hudson.epub"
Content-Transfer-Encoding: base64

UEsDBBQAAAAAANuKeT9vYassFAAAABQAAAAIAAAAbWltZXR5cGVhcHBsaWNhdGlvbi9lcHViK3pp
cFBLAwQUAAAACADaink/ZEg+NrQAAAAMAQAAFgAAAE1FVEEtSU5GL2NvbnRhaW5lci54bWxVjsEK
wjAQRO/9irBXqdGbhLaC4FnBL1jTrQbT3dBsRf/e6EH0ODDz3jTbxxjNnaYchFtYL1dgiL30gS8t
zDrUGzBZkXuMwtQCC2y7qvHCioFpMmXPuVQndoI5ZMc4UnbqnSTiXvw8Eqv71Nx3Bv/OrjKmmUR0
CJHyO/1kM8wx1gn12sJhvzue7BtToEtJA5iR+oC1PlN5hynF4FEL2AqdUy4zf8MLLYof7EdjfzyN