Book Contents

Book Index

Mail

The Mail module is used to define a mailbox and set it up correctly. Mail can be opened using the tree menu of the module Communication / Mail / Email accounts settings.

Book Contents

Book Index

Email accounts settings

To be able to use mail in scripts, it is necessary to set the connection parameters to the mailboxes using the Email accounts settings function.

Email boxes tab

The Email boxes tab shows a list of all defined accounts of the logged-in user. When Email accounts settings is opened, K2 checks whether any accounts have already been created, and if it finds none, it generates new ones. For each user, two mailboxes are created after logging in to IS K2 - one internal and one external. K2 distinguishes between external and internal accounts based on the set e-mail address:

When saving Email accounts settings, IS K2 checks:

Note: The internal mailbox is no longer used in the standard and remains here only for historical reasons, as the internal mailbox may be used in special scripts.

Warning: Sending e-mails via the new Outlook is not supported.

pic_1244_202402

Picture: Email accounts settings form - Email boxes tab

Signatures tab

The Signatures tab contains a list of all defined signatures, which are then set on individual accounts.

pic_10232

Picture: Email accounts settings form - Signatures tab

Description of functions in the ribbon

Global proxy

The global proxy setting allows the user to share proxy values between different accounts, which eliminates the need to repeatedly enter the same data for each account.

Admin view

The action is available only to a user with the Service operations right. The administrator can view and change the email account settings of all K2 users.

Bulk settings

This action is available only to users with the Service operations right. It is used for bulk setting of the protocols used for multiple email accounts. First, the administrator selects the accounts to be changed, and then fills in the values for receiving and sending mail. These values are then written to all the selected accounts. Names and passwords remain unchanged.

The setup of an email account depends on its intended purpose. Apart from setting up the mail servers, the operator must focus primarily on the following during setup:

Book Contents

Book Index

Mailbox settings

Press the Enter key or double-click to open the settings of the given e-mail box.

Basic data tab

pic_9879_202402

Picture: Mailbox settings form - Basic data tab

Description of fields:

Name of account

Field for any account name.

Your name

The name that will be used when sending messages from this account.

E-mail address

Field for entering the e-mail address.

Address for replies

Address for sending replies. An empty value here means replying to the same address. Multiple addresses separated by commas can be entered in the field.

Default mailbox for sending

This option can be checked for only one mailbox of all those defined. The flag must be set on the mailbox that the user will use to send e-mails from a script, e.g. Export to email.

Use to receive and send

If the user also wants to receive mail in their mailbox, this option must be checked.

Save copy of sent message

If the field is checked, a copy of the sent mail is saved in the Sent folder.

Display

A mailbox with this setting is displayed in the list of all accounts in the Mail book.

Hidden copy to myself

If this field is checked, the sender's address is always automatically added to the blind copy of an e-mail sent via this mailbox. The user can thus be informed about all sent e-mails.

Interval to check for new messages

Interval for checking for new messages. It is specified in minutes.

Post client

Selection of the mail client for editing messages.

Format for creating reports

Default text format for creating new messages.

Signature

Field for selecting a signature.

OAuth2

The OAuth2 authentication setting under this button allows its values to be shared for both Post sending and Post receipt, which means that the user does not have to enter these values repeatedly for each setting separately. On the Post sending / Post receipt tab, if the OAuth2 authorization protocol is selected, it is sufficient to check the "Superior" option.

Test connection

Button for testing the mailbox settings. A message about the connection status is displayed.

Post sending tab

On the Post sending tab, we choose the method of sending mail from this account. After selecting the protocol, other relevant fields required for the setup are displayed.

Individual protocols may require authentication using a name and password or using the OAuth2 protocol. For the procedure to set up OAuth2, see Setting up a Google account in IS K2 and Microsoft authorization. If the OAuth2 authorization protocol is selected, checking the "Superior" option allows the OAuth2 authentication settings to be taken over from the Basic data tab.

pic_9880_202402

Picture: Mailbox settings form - Post sending tab

MAPI

For MAPI to work, the following 2 conditions must be met:

  1. The e-mail client must be compiled for the same architecture as the K2 client. If the e-mail client is opened from the 32-bit desktop client, the e-mail client must also be 32-bit. If e-mails are sent from 64-bit WebNative, the e-mail client must be 64-bit.
  2. The registry must contain the value HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Messaging Subsystem MAPI = 1. Again, this depends on whether it is a 32-bit or 64-bit client, as each architecture has its own values. We recommend setting both the 32-bit and the 64-bit registry.

pic_10468

Post receipt tab

The Post receipt tab is used to define the way in which the user will receive mail in this account. The user selects the relevant protocol here. After selecting the protocol, other relevant fields required for the setup are displayed. The same conditions apply to authentication as for Post sending.

pic_9881_202402

Picture: Mailbox settings form - Post receipt tab

Settings tab

On the Settings tab, we set the proxy server. If the user has multiple email accounts and does not want to repeatedly enter the same values for each account, they can simply check the "Use global settings" option and set the values for the proxy used via the Global proxy function.

In the Confirmation section, the user can set a request for a read receipt of the e-mail. The other party may or may not comply with this request.

pic_9882_202402

Picture: Mailbox settings form - Settings tab

Book Contents

Book Index

Setting up a Google account in IS K2

If the user wants to use their Google account within a mailbox in IS K2 and use this account for sending e-mails, they must set up its authorization. This process involves several steps.

It is no longer possible to use so-called basic authentication (login using a user name and password) to log in to a Google account from third-party applications. For these purposes, it is necessary to use the so-called OAuth2 protocol.

The entire authentication process consists of creating a project for a specific Google account within the Google Cloud Platform console, which is available at https://console.cloud.google.com/.

Subsequently, within this project, it is necessary to create an application for the OAuth2 authorization protocol and create Credentials (a verification client) of the OAuth2 protocol.

The last step is to enter the data of this project into IS K2.

Book Contents

Book Index

Creating a Google Cloud Platform project

Within their Google account, the user who wants to send e-mails from IS K2 must have a project created in the Google Cloud Platform console. The URL address of this console is https://console.cloud.google.com/. A prerequisite is that the user is logged in to the given Google account in the web browser.

pic_7187

Picture: Home screen of the Google Cloud Platform console

A new project on Google Cloud Platform is created by clicking Select a project and then the NEW PROJECT option.

pic_7190

Picture: Creating a new project

On the next screen, set the project name in the Project name field.

pic_7191

Picture: Entering the project name

Confirm the creation of the project with the CREATE button.

Book Contents

Book Index

Creating an application for the OAuth2 protocol

Within the created project in Google Cloud Platform, it is further necessary to set up an application for the OAuth2 authorization protocol.

The project must be selected in the Google Cloud Platform console. After creation, it is set here. However, if it is not currently set, select it using the button with the project name.

pic_7192

Picture: Button for selecting projects

A list of all projects of the Google account in the console is always displayed. Select the required project from this list.

Using the pic_1181i icon, display all available project options and select APIs & Services here.

pic_7194

Picture: Displaying the APIs & Services section

In the APIs & Services section, then click the OAuth consent screen option. Here, create an application for verification with the OAuth2 protocol.

pic_7195

Picture: Creating an application for OAuth2

Here, first select the External option and confirm the choice with the CREATE button.

On the next screen, enter the name of the application in the App name field and enter a contact e-mail in the User support email field. As a rule, we enter the e-mail address of the Google account whose project in Google Cloud Platform we are working with. Another mandatory field is Developer contact information at the bottom of the screen. An e-mail address must be entered here as well.

pic_7196

Picture: Other settings of the application for OAuth2

The settings can then be confirmed with the SAVE AND CONTINUE button.

The next step of creating "Scopes" can be skipped by pressing the SAVE AND CONTINUE button again.

Next, we get to the screen where it is necessary to set the users of the application for the OAuth2 protocol.

pic_7197

Picture: Setting users for the application

Here, the user of the specific Google account for which this project is created and from which e-mails will be sent from IS K2 must be entered. Add the user here using the ADD USERS button. Then fill in the e-mail address and confirm adding the user with the ADD button. After adding the user, confirm the whole screen again with the SAVE AND CONTINUE button. Then the last screen, Summary, is displayed with an overview of the application data for the OAuth2 protocol.

The application is created and we can click the BACK TO DASHBOARD button here.

pic_7198

Picture: Completing the creation of the application

Book Contents

Book Index

Setting up Credentials (verification) of the application for the OAuth2 protocol

The next step for the application for the OAuth2 protocol to work is setting up the so-called Credentials (verification). This is essentially creating an OAuth client for verification. In the project, click the Credentials section and then the + CREATE CREDENTIALS button.

pic_7199

Picture: Creating an OAuth client

In the context menu, then select the OAuth client ID option.

pic_7200

Picture: Context menu for selecting the verification type

A screen is displayed where you select Desktop app in the Application type field. This is because it is an application for the desktop version of IS K2.

pic_7201

Picture: Selecting the application type for verification

On the next screen, enter a name for identification within the console, and press the CREATE button to create the verification.

pic_7202

Picture: Confirmation for creating an OAuth client for verification

The verification client is created and a window is displayed containing two fields, Client ID and Client Secret. The keys from these fields are very important for setting up e-mail sending from IS K2 via a Google account.

pic_7203

Picture: Client ID and Client Secret for setup in IS K2.

Further settings for the correct functioning of e-mail sending must be made in IS K2.

Book Contents

Book Index

Settings in IS K2

Further settings for sending e-mails from IS K2 via a Google account must be made directly in IS K2 in the Mail module. All data for the Google account is entered here in the settings of the given mailbox.

So if we want to set up a Google account here, it is first necessary to enter the e-mail address in the E-mail address field on the Basic data tab.

pic_7204_2024

Picture: Settings on the Basic data tab

Next, on the Post sending tab, select the SMTP option. After selecting the SMTP protocol, further data required for sending e-mail via the SMTP protocol is displayed. Enter the Server address (smtp.gmail.com), Port (587) and Secure connection (Explicit TLS).

pic_7205_2024

Picture: Settings on the Post sending tab

Instead of verifying the account using a name and password, we must set identity verification using the OAuth2 protocol here. After selecting the OAuth2 authorization protocol, all the data required to set up this protocol is displayed.

pic_7206_2024

Picture: Setting up the OAuth2 protocol in IS K2

Description of fields:

Client ID

Here it is necessary to enter the Client ID obtained by creating a client for verification of the OAuth2 protocol (OAuth client) within Google Cloud Platform.

Client Secret

Here it is necessary to enter the Client Secret obtained by creating a client for verification of the OAuth2 protocol (OAuth client) within Google Cloud Platform.

Authorization URI

The field is filled in automatically with the value intended for a Google account. The program fills it in automatically if it identifies a Google account in the E-mail address field on the General tab. The identification is based on the "*.gmail.com" suffix. If the e-mail address does not contain this suffix, the field must be filled in manually. The value for Google is: "https://accounts.google.com/o/oauth2/v2/auth".

Token URI

The field is filled in automatically with the value intended for a Google account. The program fills it in automatically if it identifies a Google account in the E-mail address field on the General tab. The identification is based on the "*.gmail.com" suffix. If the e-mail address does not contain this suffix, the field must be filled in manually. The value for Google is: "https://oauth2.googleapis.com/token".

Scope

The field is filled in automatically with the value intended for a Google account. The program fills it in automatically if it identifies a Google account in the E-mail address field on the General tab. The identification is based on the "*.gmail.com" suffix. If the e-mail address does not contain this suffix, the field must be filled in manually. The value for Google is: "https://mail.google.com/".

Update token

The field is filled in automatically after the account is verified. For verification, press the Access token button and then use the Get/Update option. A web browser is displayed prompting you to log in to the Google account. After logging in, verification takes place and the Update token field is automatically filled in with a value.

Expiration

Date and time of expiry of the Update token. The token is valid for 1 hour, after which it is updated automatically. The token can also be updated manually.

Forget/Remove token

Removes the update token. It must then be loaded and authorized again.

Get/Update token

Loads the web page for authorization of the update token.

Book Contents

Book Index

Microsoft authorization

It is no longer possible to use so-called Basic authentication (login using a user name and password) to log in to a Microsoft account.

So if users want to use a mailbox in IS K2 for receiving and sending e-mails via protocols such as IMAP, POP3 or SMTP, they must set up so-called Modern authentification. This is authentication via the OAuth2 protocol.

Book Contents

Book Index

Creating an application in Microsoft Azure

A prerequisite for using OAuth2 authorization is creating an application within the Microsoft Azure service. It is available at https://portal.azure.com/.

The application must then be created and set up in the Azure Active Directory section, in the App registrations part.

pic_7597

Picture: Creating an application within Microsoft Azure

After creating the application, you will be automatically redirected to a page with an overview of the basic data of this application. This is the Overview section.

pic_7601

Picture: Basic data of the application

There are two important data items here: Application (client) ID and Directory (tenant) ID. These must be entered in IS K2 in the form for setting up OAuth2 authorization.

In the menu on the left side of the page, go to the Certificates & secrets part. Here it is necessary to generate a new "secret" code. To do so, click the New client secret text.

pic_7603

Picture: Certificates & secrets

A page is then displayed where it is necessary to enter a Description and the Expiry of the secret.

pic_7605

Picture: Creating a secret

Create a new secret with the Add button.

pic_7606

Picture: Client secret value

After creation, we recommend copying the value of the secret ID. After the page is refreshed, this is no longer possible. This ID must also be entered in IS K2 in the form for setting up OAuth2 authorization.

In the left menu, then select the Authentication option.

pic_7615

Picture: Allowing public client flows

Here it is necessary to allow public client flows by clicking the Yes button. Then save the applied change with the Save button.

In the next step, select the API permissions option from the left menu.

pic_7616

Picture: API permissions

Here, use the Add a permission button to display a list of possible permissions that can be set. In this list, select the Microsoft Graph option.

Next, select the Delegated permissions option. A list of all available permissions is displayed. In the Mail part, select the Mail.Send option.

pic_7617

Picture: Setting the Mail.Send permission

In the list of permissions, in the User part, then select the User.Read option.

pic_7618

Picture: Setting the User.Read permission

Save the changes made with the Add permissions button. The selected permissions are saved. Use the Grant admin consent for MSFT button to grant this consent here.

pic_7619

Picture: Admin consent for MSFT

For further settings, display the Authentication tab in the left menu. To add a new platform, click the Add a platform button here.

pic_7620

Picture: Platform configuration

In the list of applications, select the Web option. Further settings for this platform are displayed.

pic_7621

Picture: Configuration of the Web platform

Here, in the upper part, set the Redirect URI to the value "http://localhost". In the lower part, check both flags Access tokens and ID tokens. Save the settings with the Configure button.

A comprehensive guide on how to create and set up an application in the Microsoft Azure environment is available here: https://intercom.help/security-studio/en/articles/5087114-setup-email-smtp-settings-with-office365-oauth2-authentication.

Book Contents

Book Index

Settings in IS K2 - Microsoft

Further settings for authorization using the OAuth2 protocol must be made directly in IS K2 in the Mail / Mailbox settings module. All data for this protocol and Microsoft authorization is available via the OAuth 2. button

pic_7622_2024

Picture: Button on the form for setting up the OAuth 2 protocol

Pressing the button displays a form for entering the data from the application created in the Microsoft Azure environment.

pic_7623_2024

Picture: Setting up the OAuth2 protocol for Microsoft in IS K2

Description of fields:

Client ID

Here it is necessary to enter the Application (client) ID obtained by creating the application in the Microsoft Azure environment.

Tenant ID

Here it is necessary to enter the Directory (tenant) ID obtained by creating the application in the Microsoft Azure environment.

Client Secret

Here it is necessary to enter the Client secret obtained by creating the application in the Microsoft Azure environment.

Authorization URI

The field is filled in automatically with the value intended for a Microsoft account.

Token URI

The field is filled in automatically with the value intended for a Microsoft account.

Scope

The field is filled in automatically with the value intended for a Microsoft account.

Update token

The field is filled in automatically after the account is verified. For verification, press the Access token button and then use the Get/Update option. A web browser is displayed prompting you to log in to the Microsoft account. After logging in, verification takes place and the Update token field is automatically filled in with a value.

Expiration

Date and time of expiry of the Update token. The token is valid for 1 hour, after which it is updated automatically. The token can also be updated manually.

Get/Update token

Loads the web page for authorization of the update token.

Forget/Remove

Removes the update token. It must then be loaded and authorized again.

Note:

If the message "Authentication unsuccessful, SmtpClientAuthentication is disabled for the Mailbox. Visit https://aka.ms/smtp_auth_disabled for more information." appears when testing the connection, the Authenticated SMTP protocol must be enabled for the given mailbox. It can be enabled in two ways:

1. Using Exchange Online PowerShell - the command should enable Authenticated SMTP for all users.

Set-TransportConfig -SmtpClientAuthenticationDisabled $false

2. The recommended way using the admin center https://admin.microsoft.com, where the administrator enables the Authenticated SMTP protocol for the selected mailbox.

pic_10408

pic_10409

pic_10410

pic_10411

pic_10412

pic_10413

Scripts, Functions

Contact person scripts can be found in the Script catalogue.