Email Jobs: Defining the Mail Job Page
Automic Automation Mail Jobs provide functions that allow you to download, delete or copy emails with or without attachments from the mailbox folder and store them in a local directory. You can include or exclude emails to be processed by using predefined filter definitions. The Mail Job page includes a General Section and a Filters Section where you define the parameters relevant to processing the emails on the email server.
On the Mail Job page you define the parameters relevant to run that job on the mail server from Automic Automation.
Mail Jobs: General Section
-
Mailbox Connection
Select the Email Integration Connection object containing the relevant information to connect with the mail server.
To search for a Connection object, start typing its name to limit the list of the objects that match your input.
-
Function
Select the function you want to perform through a dropdown menu. Once you have selected the dropdown entry, only the relevant fields for the corresponding function are displayed.
-
DOWNLOAD
Downloads all included emails to the working directory you define. You can create memo TXT files that contain all values from the original email, such as the body, subject, sent to, sent from, etc., and use them for follow-up processing. You can download attachments such as TXT or CSV files, PDFs, etc. Attached emails are stored as files using the following format: <SUBJECT>.eml. Special characters are replaced by underscore characters ("_"). After the complete and successful download of the email, an empty finish indicator file ("xxxx_finish.txt" is created. You can use it for follow-up processing.
Specific parameters:
- Workspace directory
Represents the directory on the Mail Agent computer where all emails should be stored after download. Attachments are also stored here if this option is not disabled.
Tip:Instead of manually typing your workspace directory, you can select your directory from the folder picker on the right side.
-
Sub Directory
-
RUNID (default)
Downloads the emails and their attachments to separate folders in the specified directory, starting with the run ID as the prefix followed by the sequence number—for example, 2091373_1, 2091373_2.The Report (REP) lists all the created directories, while the Agent log (PLOG) provides information on the number of parsed messages. See also Reports
-
NONE
Downloads all the emails and their attachments directly under the workspace directory. It will override existing attachments but not the files, as they are unique because of their run IDs. The Report (REP) remains empty, but the Agent log (PLOG) provides information on the number of parsed messages. See also Reports
-
- Save attachment (default)
(Optional) Disable this option if you do not want to download the attachments of the selected emails to the workspace.
- Destination Folder
(Optional) Suppose you enter a mailbox folder name different from the Mailbox Folder defined in the corresponding field above. In that case, the original email is not only flagged as "read" (if selected) but also copied to this mailbox folder.
Note:This folder must exist within the selected mailbox.
- Delete Source Mail
(Optional) Use this flag to move the selected mails to the specified Destination Folder with the original mail being deleted. Alternatively, you can only delete the source mail after it has been downloaded. For this purpose, set this flag and leave the Destination Folder empty.
- Workspace directory
-
DELETE
Allows you to access a mailbox folder and change its contents without further actions such as downloading.
Important!All selected emails are deleted without any checkback.
-
COPY
Copies and moves mails from one mailbox folder to another if you do not require a downloaded copy.
Specific parameters:
-
Destination Folder
The destination to which to copy or move (delete source mail) the original mail (for example, ARCHIVE). The displayed fields are specific to the COPY function but work the same way with the DOWNLOAD function. -
Delete Source Mail
(Optional) Use this flag to move the selected mails to the specified Destination Folder with the original mail being deleted; alternatively, you can only delete the source mail after it has been downloaded. For this purpose, set this flag and leave the Destination Folder empty.
-
-
-
Mailbox Folder
Folder or subfolder in which the function is performed. By default, the mailbox folder which is processed most, is the default INBOX folder. However, you can also choose a different mailbox folder like a subfolder within the mailbox folder tree with the format <"FOLDER">/"SUBFOLDER">/...
-
Destination Folder
(Optional) The original mail is copied to the mailbox folder you define here.
-
Delete Source Mail
Enable this checkbox to delete the mail after the task defined in Function is complete.
-
(Optional) Define a numeric code that should be returned if no mail is found.
-
1 (default)
No mail was found
-
0
Sets the mail job status to ENDED_OK
Example: If you select DELETE as the Function option, the chosen emails are unavailable after the job run because the mail job deletes them. By setting this parameter to 0, the mail job status is set to ENDED_OK even if no email was selected for deletion. Any other error still produces a return code and causes the job to abort.
-
Email Jobs: Filters Section
Before downloading emails, you can use filters to include or exclude mails from processing.
-
Status
Select the desired mail status from the available dropdown menu:
- UNREAD (default)
- READ
- ALL
You can use regular expressions to parse the following additional mail fields:
-
Sent From
(Optional) Use this filter to get the mails that match the value defined here. You can filter by using regular expressions.
-
Sent To
(Optional) Use this filter to get the mails that match the value defined here. You can filter by using regular expressions.
-
Sent To CC
(Optional) Use this filter to get the mails that match the value defined here. You can filter by using regular expressions.
-
Subject
(Optional) Use this filter to get the mails that match the value defined here. You can filter by using regular expressions.
-
Older Than (Days)
(Optional) Provide the value in days to get the mails older than the provided value. Number of days since the mail was received.
To change the values of the above field names dynamically, you can use scripts. For this purpose, you need to know their corresponding attribute names which are listed in the next topic.
See also: