Delete emails from a mail server
- Dernière mise à jour2022/10/28
Delete emails from a mail server
The Delete All Messages action of the Email Automation command enables you to delete emails from a mail server
If you choose the server type as the Exchange Web Services (EWS) using OAuth authentication, the Tenant ID and Client ID fields are mandatory although the interface displays these fields as optional because they can be skipped for Basic Authentication. The recommended practice is to use OAuth authentication for enhanced security.
Procedure
To delete emails from a mail server, do the following:
-
Double-click or drag one of the Email Automation commands to the Task
Actions List pane.
The Email Automation dialog box appears.
- Select the Delete All Messages option to delete emails from the mail server.
-
Select an option from the Server Type section.
- IMAP
- POP3
- EWS
-
Specify details of the email server:
-
For IMAP and POP3 server
specify the following details:
-
Version 11.3.5.7, Version 11.3.1.13, Version 11.3.4.8 or later :
- Host Name: Host name of the email server.
- User Name: User name you want to use to connect to the email server.
- Server uses secure connection (SSL): Select this option if the email account uses secured connection.
- Port Number: Port that you want to use to connect to the email server.
-
Auth Type: Choose from the
following authentication types:
- Basic: Uses the username and password.
-
OAuth2 – Client
credentials: Uses client credentials
flow.
See Authenticate an IMAP, POP or SMTP connection using OAuth
-
OAuth2 – Authorization code with
PKCE: Uses authorization code with
PKCE grant flow.
See Microsoft identity platform and OAuth 2.0 authorization code flow
Option Description Basic Enter the password for the username you provided. OAuth2 – Client credentials Provide the following details: - Client ID and Tenant ID: Enter the unique client and tenant IDs generated when you registered the application in the Microsoft Azure portal.
- Client secret: Enter the client secret that you generated for your app in the app registration portal.
OAuth2 – Authorization code with PKCE Provide the following details: - Client ID and Tenant ID: Enter the unique client and tenant IDs generated when you registered the application in the Microsoft Azure portal.
- Redirect URI: The redirect URI in your Azure app registration portal.
-
Connect: Click this
option to sign into your account, accept the
permissions requested to authenticate, and
establish a connection with the OAuth server.Note: You must establish the connection only when you connect for the first time.
Keep the following considerations in mind when you use authorization code with PKCE.- Ensure that the redirect URL format is
http://localhost:9090/callback
- In Redirect URL, only HTTP is supported.
- URL
urn:ietf:wg:oauth:2.0:oob
is required while configuring the PKCE on Azure portal. - You can add only Mobile and desktop applications when you configure the platforms in Azure portal.
- The consent page appears only for the first time when you authenticate for the first time. However, when you run your email automation, each time, you are asked to sign in to your Microsoft account and provide the username and password.
- To log in to your Microsoft account, you must provide the same username that you provided in the Email Automation command to run the bots.
-
Note:
- For attended email automation, use PKCE flow.
- The email automation created using Version 11.3.5.7 (Basic and OAuth2.0) will not work in the environments where earlier versions of Enterprise 11 (prior to Version 11.3.5.7) clients are used. However, if the bot is not modified in Version 11.3.5.7, it will continue to work in the earlier versions. Any changes to the email command fields will update the internal structure, and the bots will not work in the earlier versions after these changes.
- As a best practice, use credential variables for the client secret, password, and other related fields to avoid storing sensitive information.
The above points also apply to Version 11.3.1.13 and Version 11.3.4.8.
-
Prior to Version 11.3.5.7, Version 11.3.1.13, and Version 11.3.4.8
:
- Host Name: Host name of the email server.
- User Name: User name you want to use to connect to the email server.
- Password: Password you want to use to connect to the email server.
- Server uses secure connection: Select this option if the email account uses secured connection.
- Port Number: Port that you want to use to connect to the email server
-
Version 11.3.5.7, Version 11.3.1.13, Version 11.3.4.8 or later :
-
For Exchange Web Services (EWS), specify the
following details:
- Domain Name: Domain name of the EWS server.
- User Name: User name you want to use to connect to the email server.
- Password: Password you want to use to connect to the email server.
- Client ID and Tenant ID: Enter the unique client and tenant IDs generated when you registered the application in the Microsoft Azure portal. These fields are required for OAuth.
- Exchange Version: Select an option from the list to specify the version of the EWS server you want to use.
-
Exchange Url: Specify the
URL of the EWS server.
You can click the Fetch option to populate the Exchange Url field based on the values you have provided in the User Name and Password fields.
-
For IMAP and POP3 server
specify the following details:
-
Select an option to specify the emails to be deleted:
- All: Deletes all emails.
- Read: Deletes emails that are read.
- Unread: Deletes emails that are unread.
Note: This option is not available for POP3 type email server. -
Click Save.
The system stores various information about emails retrieved such as subject, sender, and message in system variables. See Email System Variables.