After the Open Directory crashed several times on a osx server 10.9 I decided to start from scratch; formatting the disk, installing osx 10.9 and setting up server.app as it was before.
To recover the mails I though being smart and copying the contents of the mailbox per user (Location /Library/Server/Mail/Data/mail/[OLD GUID]) to the fresh setup. Logging in showed everything in the inbox. Now, few days later I find out that the sent folder is empty, or doenst contain any mails before the install. Turns out that only the inbox is copied.
Does someone has any suggestions how I can get back the sent items?
After some more research I solved my question; I hope that this helps my fellow colleagues in saving time and nightmares.
(Sub)Folders in dovecot have their own directory, starting with a dot (.), for example .Sent Messages. Because of that dot the folder is hidden. I copied the subfolders to the new mail directory, updated the correct user permissions and was able to get the old messages back.
If the user (or client software) already has added the same folder, simply rename it. Another possibility is to add a temporary user, restore the e-mails to that one. On the users mail client you add this temporary mailbox and move the messages to the correct folder. This last solution only works good when there are not too much messages.
What really helped me as well was connecting IMAP via the terminal using openssl, an easy guide can be found here.