Search in sources :

Example 26 with ImapConnection

use of com.zimbra.cs.mailclient.imap.ImapConnection in project zm-mailbox by Zimbra.

the class TestRemoteImapMultiServer method connectAsProxy.

private ImapConnection connectAsProxy(Server server) throws IOException {
    ImapConfig config = new ImapConfig(server.getServiceHostname());
    config.setPort(server.getImapBindPort());
    config.setAuthenticationId(USER);
    config.setAuthenticatorFactory(ZIMBRA_AUTH_FACTORY);
    config.setMechanism(ZimbraAuthenticator.MECHANISM);
    config.getLogger().setLevel(Log.Level.trace);
    ImapConnection connection = new ImapConnection(config);
    connection.connect();
    return connection;
}
Also used : ImapConfig(com.zimbra.cs.mailclient.imap.ImapConfig) ImapConnection(com.zimbra.cs.mailclient.imap.ImapConnection)

Example 27 with ImapConnection

use of com.zimbra.cs.mailclient.imap.ImapConnection in project zm-mailbox by Zimbra.

the class TestRemoteImapMultiServer method connect.

private ImapConnection connect(Server server) throws IOException {
    ImapConfig config = new ImapConfig(server.getServiceHostname());
    config.setPort(server.getImapBindPort());
    config.setAuthenticationId(USER);
    config.getLogger().setLevel(Log.Level.trace);
    ImapConnection connection = new ImapConnection(config);
    connection.connect();
    return connection;
}
Also used : ImapConfig(com.zimbra.cs.mailclient.imap.ImapConfig) ImapConnection(com.zimbra.cs.mailclient.imap.ImapConnection)

Aggregations

ImapConnection (com.zimbra.cs.mailclient.imap.ImapConnection)27 ImapConfig (com.zimbra.cs.mailclient.imap.ImapConfig)11 IOException (java.io.IOException)7 CommandFailedException (com.zimbra.cs.mailclient.CommandFailedException)5 ServiceException (com.zimbra.common.service.ServiceException)4 Test (org.junit.Test)4 Account (com.zimbra.cs.account.Account)2 AuthenticatorFactory (com.zimbra.cs.mailclient.auth.AuthenticatorFactory)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 OutputStream (java.io.OutputStream)2 Ignore (org.junit.Ignore)2 LocalConfig (com.zimbra.common.localconfig.LocalConfig)1 RemoteServiceException (com.zimbra.common.service.RemoteServiceException)1 ZMimeMessage (com.zimbra.common.zmime.ZMimeMessage)1 AccountServiceException (com.zimbra.cs.account.AccountServiceException)1 CacheEntry (com.zimbra.cs.account.Provisioning.CacheEntry)1 ImapAppender (com.zimbra.cs.datasource.imap.ImapAppender)1 PurgedConversation (com.zimbra.cs.db.DbDataSource.PurgedConversation)1 PurgedMessage (com.zimbra.cs.db.DbDataSource.PurgedMessage)1 MailServiceException (com.zimbra.cs.mailbox.MailServiceException)1