The IMAP folder contents will of course normally be email. But in the special folders containing notes, events, tasks and so on, the following rule applies.
We store on note/event/task/... in each mail on the IMAP server. The mail we store in will have a so far undefined text as the body (could for example be a link to www.kolab.org and say why you can not view this as a normally mail) (TODO: Define the body contents or make it be a thing for the client to decide), and any number of attachments. One of these attachments will be the XML file containing the actual entry (the note/event/task/...). The mimetype of this attachment will be "application/x-vnd.kolab.<type>" where type is the content type of the file. Some of these attachments can be referenced in the file, and these are "owned" by the XML file, meaning if the client application deletes the attachment reference, the attachment should also be deleted. Those attachments that are not referenced must be preserved when the mail is saved again.