I know that you are requesting libraries, not all solutions, however I found them with Java based servers:
As for libraries, you will need libraries that can:
- Listen to IMAP Requests
- SSL processing
- Authentication libraries [to verify the requesting user from your directory]
- Caching frameworks to handle multiple requests for the same object
IMAP , .