public class MailboxConnection extends AbstractEmailConnection
PASSWORD_NO_USERNAME_ERROR, protocol, session, USERNAME_NO_PASSWORD_ERROR| Constructor and Description |
|---|
MailboxConnection(EmailProtocol protocol,
String username,
String password,
String host,
String port,
long connectionTimeout,
long readTimeout,
long writeTimeout,
Map<String,String> properties)
Creates a new instance of the of the
MailboxConnection. |
MailboxConnection(EmailProtocol protocol,
String username,
String password,
String host,
String port,
long connectionTimeout,
long readTimeout,
long writeTimeout,
Map<String,String> properties,
org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory)
Creates a new instance of the of the
MailboxConnection secured by TLS. |
| Modifier and Type | Method and Description |
|---|---|
void |
closeFolder(boolean expunge)
Closes the current connection folder.
|
void |
disconnect()
disconnects the internal client used by the
AbstractEmailConnection instance. |
javax.mail.Folder |
getFolder(String mailBoxFolder,
int openMode)
Opens and return the email
Folder of name mailBoxFolder. |
org.mule.runtime.api.connection.ConnectionValidationResult |
validate()
Checks if the current
AbstractEmailConnection instance is valid or not. |
getSessionpublic MailboxConnection(EmailProtocol protocol, String username, String password, String host, String port, long connectionTimeout, long readTimeout, long writeTimeout, Map<String,String> properties, org.mule.runtime.api.tls.TlsContextFactory tlsContextFactory) throws EmailConnectionException
MailboxConnection secured by TLS.protocol - the desired protocol to use. One of imap or pop3 (and its secure versions)username - the username to establish the connection.password - the password corresponding to the username.host - the host name of the mail serverport - the port number of the mail server.connectionTimeout - the socket connection timeoutreadTimeout - the socket read timeoutwriteTimeout - the socket write timeoutproperties - additional custom properties.tlsContextFactory - the tls context factory for creating the context to secure the connectionEmailConnectionExceptionpublic MailboxConnection(EmailProtocol protocol, String username, String password, String host, String port, long connectionTimeout, long readTimeout, long writeTimeout, Map<String,String> properties) throws EmailConnectionException
MailboxConnection.protocol - the desired protocol to use. One of imap or pop3 (and its secure versions)username - the username to establish the connection.password - the password corresponding to the username.host - the host name of the mail serverport - the port number of the mail server.connectionTimeout - the socket connection timeoutreadTimeout - the socket read timeoutwriteTimeout - the socket write timeoutproperties - additional custom properties.EmailConnectionExceptionpublic javax.mail.Folder getFolder(String mailBoxFolder, int openMode)
Folder of name mailBoxFolder. The folder can contain Messages, other Folders or
both.
If there was an already opened folder and a different one is requested the opened folder will be closed and the new one will be opened.
mailBoxFolder - the name of the folder to be opened.openMode - open the folder in READ_ONLY or READ_WRITE modeFolderpublic void closeFolder(boolean expunge)
expunge - whether to remove all the emails marked as DELETED.public void disconnect()
AbstractEmailConnection instance.disconnect in class AbstractEmailConnectionpublic org.mule.runtime.api.connection.ConnectionValidationResult validate()
AbstractEmailConnection instance is valid or not.validate in class AbstractEmailConnectionConnectionValidationResult indicating if the connection is valid or not.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.