Skip to main content

Cyware Orchestrate

IMAP

App Vendor: IMAP

App Category: Email Gateway

Connector Version: 1.3.3

API Version: 1.1.0

About App

The Internet Message Access Protocol (IMAP) app enables analysts to manage emails and retrieve labels and folders from an email account using the Python email and IMAP libraries.

The IMAP app is configured with the Orchestrate application to perform the following actions:

Action Name

Description

Delete Email(s) by Sender Email ID

This action deletes emails from a folder using the email ID of the sender.

Get All Labels

This action retrieves a list of labels in a mailbox.

Move Email to Folder

This action moves an email from one folder to another.

Read Emails by Query Filter

This action reads emails that match a query filter from a specific folder.

Read Email(s) from Specified Folder

This action reads all unseen emails from a specific folder.

Read Email by Index

This action reads emails by index.

Move Email to Folder by Email Object ID

This action moves an email from a folder to another folder using the email object ID.

Configuration Parameters

The following configuration parameters are required for the IMAP app to communicate with the IMAP enterprise application. The parameters can be configured by creating instances in the app. To know more about how to add an instance, see Add Instances.

Parameter

Description

Field Type

Required/Optional

Comments

IMAP Server 

Enter the IMAP server.

Example:

"imap.gmail.com"

Text

Required

Email ID 

Enter the email ID to sign in to the IMAP server.

Example:

"john.doe@gmail.com"

Text

Required

Password 

Enter the password.

Password

Required

IMAP Server Port 

Enter the IMAP server port to connect.

Example:

"993"

Text

Optional

Default value:

"993"

Decoding Method 

Enter the decode method used for emails in the mailbox configuration.

Example:

"utf-8"

Text

Optional

Default value:

"utf-8"

SSL Verification 

Optional preference to either verify or skip the SSL certificate verification.

Example:

"True"

Boolean

Optional

Allowed values:

  • True

  • False

Default value:

True

Timeout 

Enter the timeout value in seconds. This is the number of seconds that requests will wait to establish a connection with the IMAP.

Integer

Optional

Default value:

5 seconds

TLS Verification 

Choose to either verify or skip the TLS certificate verification.

Boolean

Optional

Default value:

false

Allowed values:

  • true

  • false

Action: Delete Email(s) by Sender Email ID

This action deletes emails from a folder using the email ID of the sender.

Action Input Parameters 

Parameter

Description

Field Type

Required/Optional

Comments

Sender Email ID 

Enter the email ID of the sender.

Example:

"john.doe@gmail.com"

Text

Required

Folder Name 

Enter the folder name to delete the emails.

Example:

"inbox"

Text

Optional

Default value:

"inbox"

Example Request 

[
   {
      "sender_email_id": "john.doe@gmail.com",
      "folder_name": "inbox"
   }
]
Action: Get all Labels

This action retrieves a list of all labels in a mailbox.

Action Input Parameters

This action does not require any input parameter.

Action: Move Email to Folder

His action moves an email from one folder to another based on the sender's email ID.

Action Input Parameters 

Parameter

Description

Field Type

Required/Optional

Comments

Sender Email ID 

Enter the sender's email ID.

Example:

<sample email id>

Text

Required

Source Folder Name 

Enter the source folder name from which the email is to be moved from.

Example:

"inbox"

Text

Optional

Default value:

"inbox"

Destination Folder Name 

Enter the destination folder name to which the email is to be moved.

Example:

"trash"

Text

Optional

Default value:

"trash"

Action: Read Emails by Query Filter

This action reads emails that match a query filter from a specific folder.

Action Input Parameters 

Parameter

Description

Field Type

Required/Optional

Comments

Folder Name 

Enter a folder name to read emails.

Example:

"inbox"

Text

Optional

Default value:

"inbox"

Flag Type 

Enter a flag type to filter emails by.

Example:

"seen"

Text

Optional

Allowed values:

  • unseen

  • all

  • seen

Sender Email ID 

Enter the sender email ID to filter emails by.

Text

Optional

Default value:

"none"

Email Subject 

Enter an email subject to filter emails by.

Text

Optional

Default value:

"none"

Number of Days Since Current Date 

Enter the number of days since the current date to filter emails by.

Example:

5

Integer

Optional

Default value:

1 day

Number of Days Before Current Date 

Enter the number of days before the current date to filter emails by.

Example:

2

Integer

Optional

Default value:

0

Action: Read Email(s) from Specified Folder

This action reads all unseen emails from a specified folder.

Action Input Parameters 

Parameter

Description

Field Type

Required/Optional

Comments

Folder Name 

Enter a folder name to read the mail from.

Text

Optional

Default value: "inbox"

Only Unseen 

Optional preference to either read or not read-only unseen emails.

Boolean

Optional

Default value:

True

Number of Days Since Current Date 

Enter since number of days. This allows the user to only return emails received after a given number of days.

Example:

5

Integer

Optional

Default value:

10

Read Email by Index

This action reads emails by index.

Action Input Parameters

Parameter

Description

Field Type

Required/Optional

Comments

Index

Enter the index of the email. Example:

1

Integer

Required

Folder Name

Enter the folder name to read the emails.

Example:

"inbox"

Text

Optional

Default value:

"inbox"

Flag

Enter the flag to read the emails.

Example:

"unseen"

Text

Optional

Example Request

[
   {
      "index": 1,
      "folder_name": "inbox",
      "flag_to_fetch_email": "unseen"
   }
]
Action: Move Email to Folder by Email Object ID

This action moves an email from a folder to another folder using the email object ID.

Action Input Parameters

Parameter

Description

Field Type

Required/Optional

Comments

Email Object ID

Enter the email object ID.

Example: CAC6sg8+oKSdgwBJu1U+qvZ==PL+YABhuoAzz48CwOPgoSg_2w@mail.gmail.com.

Text

Required

 

Source Folder Name

Enter the source folder name from which you need to move the email.

Example:

Starred

Text

Optional

Default value:

Inbox

Destination Folder Name

Enter the destination folder name to which you need to move the email.

Example:

Important

Text

Optional

Default value:

Trash

Example Request

[
   {
      "message_id":"CAC6sg8+oKSdgwBJu1U+qvZ=-=PL+YABhuoAzz48CwOPgoSg_2w@mail.gmail.com",
      "src_folder_name":"Starred",
      "dest_folder_name":"Important"
   }
]