public class IMAPOperations extends Object
| Constructor and Description |
|---|
IMAPOperations() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(MailboxConnection connection,
String mailboxFolder,
long emailId)
Eliminates from the mailbox the email with id
emailId. |
void |
expungeFolder(MailboxConnection connection,
String mailboxFolder)
Eliminates from the mailbox all the messages scheduled for deletion with the DELETED flag set.
|
org.mule.runtime.extension.api.runtime.streaming.PagingProvider<MailboxConnection,org.mule.runtime.extension.api.runtime.operation.Result<Object,IMAPEmailAttributes>> |
listImap(IMAPConfiguration config,
MailboxConnection connection,
String mailboxFolder,
IMAPEmailPredicateBuilder imapMatcher,
boolean deleteAfterRetrieve,
EmailMetadataKey outputType,
int pageSize)
List all the emails (with pagination) in the configured imap mailBoxFolder that match with the specified
imapMatcher
criteria. |
void |
markAsDeleted(MailboxConnection connection,
String mailboxFolder,
long emailId)
Marks an incoming email as DELETED, this way the marked email(s) are scheduled for deletion when the folder closes, this
means that the email is not physically eliminated from the mailbox folder, but it's state changes.
|
void |
markAsRead(MailboxConnection connection,
String mailboxFolder,
long emailId)
Marks a single email as READ changing it's state in the specified mailbox folder.
|
void |
store(MailboxConnection connection,
String localDirectory,
String mailboxFolder,
String fileName,
long emailId,
boolean overwrite)
Stores the specified email of id
emailId into the configured localDirectory. |
@Summary(value="List all the emails in the given POP3 Mailbox Folder") @OutputResolver(output=EmailMetadataResolver.class) public org.mule.runtime.extension.api.runtime.streaming.PagingProvider<MailboxConnection,org.mule.runtime.extension.api.runtime.operation.Result<Object,IMAPEmailAttributes>> listImap(@UseConfig IMAPConfiguration config, @Connection MailboxConnection connection, @Optional(defaultValue="INBOX") String mailboxFolder, @DisplayName(value="Match with") @Optional IMAPEmailPredicateBuilder imapMatcher, @Optional(defaultValue="false") boolean deleteAfterRetrieve, @MetadataKeyId @Optional(defaultValue="ANY") @Placement(tab="Advanced") EmailMetadataKey outputType, @Optional(defaultValue="10") int pageSize)
imapMatcher
criteria.config - The MailboxAccessConfiguration associated to this operation.connection - The corresponding MailboxConnection instance.mailboxFolder - Mailbox folder where the emails are going to be fetchedimapMatcher - Email Matcher which gives the capability of filter the retrieved emailsdeleteAfterRetrieve - Specifies if the returned emails must be deleted after being retrieved or not.PagingProvider composed with an Result with a List carrying all the emails content and
it's corresponding IMAPEmailAttributes.@Throws(value=EmailMarkingErrorTypeProvider.class) public void markAsRead(@Connection MailboxConnection connection, @Optional(defaultValue="INBOX") String mailboxFolder, @Summary(value="Email ID Number of the email to mark as read") @DisplayName(value="Email ID") long emailId)
This operation can targets a single email.
connection - The corresponding MailboxConnection instance.mailboxFolder - Folder where the emails are going to be marked as reademailId - Email ID Number of the email to mark as read.@Throws(value=EmailMarkingErrorTypeProvider.class) public void markAsDeleted(@Connection MailboxConnection connection, @Optional(defaultValue="INBOX") String mailboxFolder, @Summary(value="Email ID Number of the email to mark as deleted") @DisplayName(value="Email ID") long emailId)
All DELETED marked emails are going to be eliminated from the mailbox when one of
expungeFolder(MailboxConnection, String) or
delete(MailboxConnection, String, long) is executed.
This operation targets a single email.
connection - The corresponding MailboxConnection instance.mailboxFolder - Mailbox folder where the emails are going to be marked as deletedemailId - Email ID Number of the email to mark as deleted.@Throws(value=EmailAccessingFolderErrorTypeProvider.class) public void expungeFolder(@Connection MailboxConnection connection, @Optional(defaultValue="INBOX") String mailboxFolder)
connection - The associated MailboxConnection.mailboxFolder - Mailbox folder where the emails with the 'DELETED' flag are going to be scheduled to be definitely
deleted@Summary(value="Stores an specified email into a local directory")
public void store(@Connection
MailboxConnection connection,
String localDirectory,
@Optional(defaultValue="INBOX")
String mailboxFolder,
@Optional
String fileName,
@Summary(value="Email ID Number of the email to delete") @DisplayName(value="Email ID")
long emailId,
@Optional(defaultValue="false") @DisplayName(value="Should Overwrite")
boolean overwrite)
emailId into the configured localDirectory.
The emails are stored as mime message in a ".txt" format.
The name of the email file is composed by the subject and the received date of the email.
connection - The associated MailboxConnection.mailboxFolder - Name of the folder where the email(s) is going to be stored.localDirectory - Local directory where the emails are going to be stored.fileName - Name of the file that is going to be stored. The operation will append the email number and received date in
the end.emailId - Email ID Number of the email to store.overwrite - Whether to overwrite a file that already exist@Summary(value="Deletes an email from the given Mailbox Folder") @Throws(value=EmailMarkingErrorTypeProvider.class) public void delete(@Connection MailboxConnection connection, @Optional(defaultValue="INBOX") String mailboxFolder, @Summary(value="Email ID Number of the email to delete") @DisplayName(value="Email ID") long emailId)
emailId.
For IMAP mailboxes all the messages scheduled for deletion (marked as DELETED) will also be erased from the folder.
connection - The corresponding MailboxConnection instance.mailboxFolder - Mailbox folder where the emails are going to be deletedemailId - Email ID Number of the email to delete.Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.