christoph ender's

blog

tuesday the 3rd of september, 2024

convert outlook .msg to .eml

Today I tried to export an e-mail from the Office 365 cloud using Outlook. The mail in question had a size of just a bit over 32 gigabytes, which meant that the OS X Version of Outlook complained about exceeding the maximum supported size and wasn't able to sync it at all. Since I didn't want to touch any of the Exchange-related configuration – no idea whether that's possible at all – I tried my luck with the Windows based version. This one was able to export the message, but if course the resulting file was in Microsoft's proprietary .msg format.

Luckily there's Joshua Tauberer's “convert-outlook-msg-file” which is able to convert the .msg files into standard, RFC822-based .eml files. Conversion on the commandline can be done as follows:

git clone https://github.com/JoshData/convert-outlook-msg-file
cd convert-outlook-msg-file
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
python outlookmsgfile.py < source-file.msg > target-file.eml