The IMAP transport handler allows the receiving of processing results as an email via IMAP.
Options
host
: The host URL of the email server. (optional, default:localhost
)port
: The port of the email server. (optional, default:993
)username
: The user name for the email account.password
: The password for the email account.folder
: The folder to read the messages from (optional, default:INBOX
)keep
: Flag to indicate if messages should be kept or deleted after reading. True if the messages should be kept, false if they should be deleted. (optional, default:true
)pattern
: A pattern to filter the messages. (optional, default: no pattern)readcontent
: Flag to indicate if the message content (body/attachements) should be read. True if the message content should be read, false otherwise. (optional, default:false
)mimetypehandler
: Sets the target data type for the content in the output schema. Possible values:string
,objectmap
. (optional, default:objectmap
)markasread
: Flag to indicate if read messages should be marked as read. True if it should be marked as read, false otherwise. (optional, default:false
)unreadonly
: Flag to indicate that only unread messages should be loaded. True if only unread messages should be fetched from the server, false if all stored messages should be loaded. (optional, default:false
)
Output schema
The IMAP transport handler generates stream elements of type Tuple with a fixed output schema:
Index | Attribute name | Data type | Description |
---|---|---|---|
0 | From | String | The senders email address |
1 | To | String List | The receivers' email addresses |
2 | CC | String List | The list of copy receiver email addresses |
3 | BCC | String List | The list of blind copy reveiver email addresses |
4 | ReplyTo | String | The reply to email address |
5 | Subject | String | The subject line of the email |
6 | SendDate | Date | The data when the email was sent |
7 | FlagDeleted | Boolean | See https://docs.oracle.com/javaee/6/api/javax/mail/Flags.Flag.html |
8 | FlagAnswered | Boolean | |
9 | FlagDraft | Boolean | |
10 | FlagFlagged | Boolean | |
11 | FlagRecent | Boolean | |
12 | FlagSeen | Boolean | |
13 | FlagUser | Boolean | |
14 | Content | Depending on the value of option String oder OptionMap | The content of the email. Depending of the emails' MIME type, it can consist of multiple body parts and/or attached files. |
Example
PQL
IMAP Transport Handler
output = ACCESS({source='ImapSource', wrapper='GenericPull', transport='IMAP', protocol='None', dataHandler='Tuple', options=[ ['host','imap.example.com'], ['folder','INBOX'], ['keep','true'], ['markasread','false'], ['unreadonly','false'], ['readcontent', 'true'], ['username','Alice'], ['mimetypehandler', 'objectmap'], ['password','***']] })