Avoid error during upload of .msg file with attachment

This fixes issues #197.