Skip to main content
Skip table of contents

IMAP

The adapter receives, copies/moves, or deletes an email message in an Internet Message Access Protocol (IMAP) mailbox, sets a flag or lists message headers in a folder of an IMAP mailbox.

The adapter supports S/MIME encrypted/signed messages and SSL encryption of the connection to the IMAP server (IMAPS). Any Java Mail properties can be processed from a properties file.

Note:

The default block size (16 KB) during message transfer can be set via the JavaMail system property mail.imap.fetchsize in the runtime environment of the X4 server (usually Java VM with application server) to optimize the download of emails via IMAP.

Example of JBossstartup script, block size is set to 5 MB:

CODE
@set JAVA_OPTS=%JAVA_OPTS% -Dmail.imap.fetchsize=5242880

Properties

Operation

Determines which operation the adapter executes

Possible values:

  • Receive Message : Receive message with ID specified in parameter messageID as UTF-8 encoded XML document.

  • Receive EML Message : Receive message with ID specified in parameter messageID and save as .eml file (MS Outlook)

Note:

You can forward the received message by directly connecting the POP/SMTP adapter after the IMAP adapter.

  • List Messages : List message headers of an IMAP folder specified in parameter folder in an UTF-8 encoded XML document.

  • Copy Message : Copy message whose message ID is specified in parameter messageID to IMAP folder specified in parameter folder

  • Move Message : Move message whose message ID is specified in parameter messageID to the IMAP folder specified in parameter folder

  • Delete Message : Delete message whose message ID is specified in parameter messageID from IMAP server

  • Set Flag : Mark message whose messageID with one or more flags specified in parameter flags

Parameters
Adapter

Main class of the adapter (do not change!)

Possible values: de.softproject.integration.adapter.imap.Adapter: Main class (default)

imapServer

IP address or host name of the IMAP server

Possible values: Any valid string (e. g. imap.1und1.de)

login

Username for the email account used

Possible values: Any string

password

Password for the email account used

Possible values: Any string

oAuth2

Defines if the OAuth 2.0 protocol is used for log-in. 

Possible values:

  • true: oAuth2 is used for log-in
  • false: oAuth2 is not used for log-in

If the OAuth 2.0 protocol is used,

  • the SSL encryption must be enabled for the connection to the IMAP server by setting the ssl parameter.
  • the access token must be entered as the password parameter. 
folder

Destination folder on the IMAP server (if the Operation property is set to Copy Message orMove Message gesetzt ist) or folder whose messages are to be listed (if the Operation property is set to List Messages )

Possible values: Existing folder name (case sensitive)

Frequently used: 

  • INBOX
  • Drafts
  • Sent Messages
  • Junk
  • Deleted Messages
  • Archive
  • Notes
srcFolder

Source folder for Copy MessageMove Message, Receive Message, Set Flag and Delete Message.

Possible values: Existing folder name (case sensitive)

Frequently used: 

  • INBOX
  • Drafts
  • Sent Messages
  • Junk
  • Deleted Messages
  • Archive
  • Notes
flags

IMAP flag(s) to identify an email message; multiple flags are separated by semicolons (;) (if the Operation property is set to Set Flag)

Possible values: Any flag (e.g. \Answered)

messageID

Message ID of the email including folder specification

Possible values: folder name and message ID (with angle brackets) (e. g. INBOX/<831921101.31255094008434.Java Mail.javamailuser@localhost>)

uid

Message ID on the IMAP server

Possible values: Any integer

maxMessages

Limit the number of messages to list when the operation property is set to List Messages. The listing starts with the oldest messages in the folder.

Possible values: Any integer

base64

Always base64 encode message attachments (multipart parts) (if Operation property is set to Receive Message )

Possible values:

  • yes: Base64 encode all multipart parts

  • no: Do not base64 encode (default)

encrypt

Messages are encrypted with S/MIME (Multipart/Encrypted)

Possible values:

  • yes: enable S/MIME encryption (requires specification of the key/certificate file in parameter Pkcs12 and the passphrase in parameter passphrase)

  • no: No encryption (default)

sign

Messages are signed with S/MIME (Multipart/Signed)

Possible values:

  • yes: Process S/MIME signature (requires specification of key/certificate file in parameter Pkcs12 and passphrase in parameter passphrase)

  • no: No signature (default)

Pkcs12

Path to a valid key/certificate file in PKCS#12 format

Possible values: Any valid path specification in the local file system of the X4 server (e.g. %USER_COLLECTION\Project\Folder\Key.p12)

passphrase

Password/passphrase to the key/certificate file in PKCS#12 format that you specified in parameter Pkcs12.

Possible values: Any valid string

port

Port of the IMAP server

Possible values:

  • Any integer (e.g. 993)

  • (no value): Use default port 143

ssl

Enable SSL encryption for the connection to the IMAP server

Possible values:

  • Yes: Use IMAP over SSL (IMAPS)

  • No: Do not encrypt connection (default)

propertiesURL

URL to a properties file (XML or text) that can contain any Java Mail properties

Possible values:

  • Any valid URL to a properties file (e.g. xstore://Project/Folder/ mail.properties)

  • (empty): Do not Java Mail properties

propertiesType

Format of the properties file specified in propertiesURL parameter

Possible values:

  • TEXT : Interpret as text properties (default)

  • XML : Interpret as XML properties

Status values

1

The operation was executed successfully.

0The operation was performed, but no result was found or no data was changed.
-1

The operation could not be performed.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.