use of com.zimbra.cs.mailclient.imap.ImapConnection in project zm-mailbox by Zimbra.
the class TestImapSync method connect.
private void connect() throws IOException {
imapConnection = new ImapConnection(config);
imapConnection.connect();
imapConnection.login(pass);
}
use of com.zimbra.cs.mailclient.imap.ImapConnection in project zm-mailbox by Zimbra.
the class ReloadLocalConfig method reloadImapDaemonLC.
private void reloadImapDaemonLC(Server server) {
ImapConnection connection = null;
try {
connection = ImapConnection.getZimbraConnection(server, LC.zimbra_ldap_user.value(), AuthProvider.getAdminAuthToken());
} catch (ServiceException e) {
ZimbraLog.imap.warn("unable to connect to IMAP server '%s'", server.getServiceHostname(), e);
return;
}
try {
ZimbraLog.imap.debug("issuing RELOADLC request to imapd server '%s'", server.getServiceHostname());
connection.reloadLocalConfig();
} catch (IOException e) {
ZimbraLog.imap.warn("unable to issue RELOADLC request to IMAP server '%s'", server.getServiceHostname(), e);
} finally {
connection.close();
}
}
use of com.zimbra.cs.mailclient.imap.ImapConnection in project zm-mailbox by Zimbra.
the class ImapTestBase method connectAndSelectInbox.
protected ImapConnection connectAndSelectInbox(String user) throws IOException {
ImapConnection imapConn = connectAndLogin(user);
imapConn.select("INBOX");
return imapConn;
}
use of com.zimbra.cs.mailclient.imap.ImapConnection in project zm-mailbox by Zimbra.
the class ImapTestBase method getAdminConnection.
protected ImapConnection getAdminConnection() throws Exception {
AuthenticatorFactory authFactory = new AuthenticatorFactory();
authFactory.register(ZimbraAuthenticator.MECHANISM, ZimbraClientAuthenticator.class);
ImapConfig config = new ImapConfig(imapServer.getServiceHostname());
config.setMechanism(ZimbraAuthenticator.MECHANISM);
config.setAuthenticatorFactory(authFactory);
config.setPort(imapPort);
config.setAuthenticationId(LC.zimbra_ldap_user.value());
config.getLogger().setLevel(Log.Level.trace);
ImapConnection conn = new ImapConnection(config);
conn.connect();
conn.authenticate(AuthProvider.getAdminAuthToken().getEncoded());
return conn;
}
use of com.zimbra.cs.mailclient.imap.ImapConnection in project zm-mailbox by Zimbra.
the class ImapTestBase method connect.
protected ImapConnection connect(String user) throws IOException {
ImapConfig config = new ImapConfig(imapHostname);
config.setPort(imapPort);
config.setAuthenticationId(user);
config.getLogger().setLevel(Log.Level.trace);
ImapConnection conn = new ImapConnection(config);
conn.connect();
return conn;
}
Aggregations