Fix up message handling.
Basic working support for attachments.