--- title: "Set up file action - Email - IMAP" slug: "set-up-file-action-email-imap" description: "Set up email file actions to receive files via IMAP, manage environments, and ensure secure connections for efficient file exchange." tags: ["Task topic"] updated: 2026-09-01T11:10:54Z published: 2026-09-01T11:10:54Z canonical: "docs.staedean.com/set-up-file-action-email-imap" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.staedean.com/llms.txt > Use this file to discover all available pages before exploring further. # Set up file action - Email - IMAP You can use the **Email** file action to exchange files with email. This topic explains how to set up a file action to receive files using an IMAP server. For **IMAP**, the direction is '**Source**'. Before the message is run, the defined email account inbox is searched for applicable emails. If found, the attached files of these emails are saved to the **Working** folder. > [!NOTE] > Note > > You can set up file actions for these connector types: > > - **Azure file storage** > - **Azure File Storage (API)** > - **Azure Blob storage** > - **SharePoint** ### Steps 1. Click **Connectivity studio - Integration Design**. 2. Click the **Connectors** tab. 3. In the list, find and select the desired connector. 4. Click **Edit**. 5. You can export the connectivity setup and import it into another D365 F&SCM environment. For example, you first set up and test the connectivity setup in a development environment. When finished, you deploy the setup in your production environment. To protect your production data, use different file locations for your development or testing environment and for your production environment. To strictly distinguish between different environments, you can define unique file action properties for each of your environment types. So, each file action can have a different set of properties for each applicable environment type. Which file action properties are applicable to the current environment is defined in the **Environment type** field on the **Connectivity studio parameters**. **Example**: If set to **Development**, the file action properties, as defined for environment type **Development** are applicable. In the **Environment types** field, select an option. > [!NOTE] > **Note** > > For each file action, you can repeat the sub-tasks for each of your environment types. To set the environment-specific properties of a file action, only change the environment type, find the file action, and set the properties. So, do not create a new file action for each environment type. 6. Expand the **File action** section. 7. Click **New**. 8. In the **Name** field, type a value. 9. In the **File action** field, select **Email**. 10. Click **Save**. 11. In the **Direction** field, select **Source**. 12. Define the name of the file to be saved from the email to the **Working folder**. You can use filtering symbols. **Example:** CustGroup*.txt. In the **File name** field, type a value. 13. You can (temporarily) disable a flow action. **Example:** In a test setup, the setup to do the file action is not available. To prevent errors during test runs of the message, you disable the file action. In this way, you do not have to change or delete the file action. In the **Skip** field, select an option. 14. In the **Email receiver** field, select **IMAP server**. 15. Define the email address of the email account to be searched for emails and attached files. So, this is the account where the emails with attached files are received. In the **Email** field, type a value. 16. Enter the server name of the IMAP mail server as given by the IMAP server provider. **Example**: imap.example.com. In the **Host name** field, type a value. 17. Define the port to be used for the IMAP server, as advised by the IMAP server provider. In the **Port** field, enter a number. 18. Select the applicable secure socket option as advised by the IMAP server provider: - **None**: No SSL or TLS encryption is used. - **Auto**: Allow the IMAP mail service to decide which SSL or TLS options to use. If the server does not support SSL or TLS, the connection continues without encryption. - **SSLOnConnect**: The connection uses SSL or TLS encryption immediately. - **STARTTLS**: Uses the TLS encryption immediately after reading the greeting and capabilities of the server. If the server does not support the STARTTLS extension, the connection fails and a NotSupportedException message is given. - **STARTTLSWhenAvailable**: The connection uses TLS encryption immediately after reading the greeting and capabilities of the server, but only if the server supports the STARTTLS extension. In the **Secure socket options** field, select an option. 19. Define the name that is used to log in to the IMAP server where the emails with attached files are received. This can be an account name or email address. In the **Account name** field, type a value. 20. Define the password or password reference that is used to log in to the IMAP server where the emails with attached files are received. Whether the password or password reference applies is defined by the **Display secret** field in the **Connectivity studio parameters**. If the **Display secret** parameter is set to: - **Secret**, fill in the **Password** field with the desired password. The password is specific for the current file action. - **Secret reference**, fill in the **Password reference** field with the desired secret reference. The password reference refers to a centrally stored password which makes updating secrets easier. - **Both**, fill in either the **Password** field or the **Password reference** field. In the **Password** field or in the **Password reference** field, type a value. 21. You can define which emails are considered when the inbox of the email account is searched. In the **Read filter** field, select an option. 22. You can filter for which senders emails are considered when the inbox of the email account is searched. In the **Sender filter** field, type a value. 23. You can filter for which subjects emails are considered when the inbox of the email account is searched. In the **Subject filter** field, type a value. 24. Close the page. ## Related - [Set up secret references](/set-up-secret-references.md)