repository = RepositoryImpl.create(config);
// Register imap cnd file
JCRUtils.registerCnd(repository, workspace, user, pass);
MailboxSessionJCRRepository sessionRepos = new GlobalMailboxSessionJCRRepository(repository, workspace, user, pass);
JVMMailboxPathLocker locker = new JVMMailboxPathLocker();
JCRUidProvider uidProvider = new JCRUidProvider(locker, sessionRepos);
JCRModSeqProvider modSeqProvider= new JCRModSeqProvider(locker, sessionRepos);
JCRMailboxSessionMapperFactory mf = new JCRMailboxSessionMapperFactory(sessionRepos, uidProvider, modSeqProvider);
mailboxManager = new JCRMailboxManager(mf, null, locker);
mailboxManager.init();