Manual Email Configuration

Use this topic to manually modify your email connection strings in cases where the installation did not properly configure email or you need to change it for some other reason.

The K2 server requires an e-mail address to be configured for the K2 installation or upgrade to automatically configure email and notifications from the server. If no e-mail address is available and K2 SmartActions is a requirement for installation, you should postpone your installation until the e-mail address is available. However, you can proceed and modify the connection strings manually if required.

A utility called ConnectionStringEditor.exe is located at "%ProgramFiles%K2\Host Server\Bin" and can be used instead of the manual approach detailed below, but read through the section below to familiarize yourself with the supported settings.

Overview of Manual E-mail Configuration

Configuring the e-mail options manually requires that connection strings are added to the K2 Server configuration file (K2hostserver.exe.config). The connectionsStrings section of the config file is encrypted. To edit the connection strings you must first delete the entire section.

Important: Back-up the K2hostserver.exe.config file before editing it.

Copy

Delete the encrypted connectionStrings section

<!-- Host Server DB Connection Settings -->
  <connectionStrings configProtectionProvider="K2ConfigurationKey">
    ...
  </connectionStrings>

Replace it with a copy of the commented-out section at the bottom of the file under the text:

        **** USE THE SETTINGS BELOW TO REPLACE ENCRYPTED SECTION.
        **** CONNECTION STRINGS WILL AUTOMATICALLY BE ENCRYPTED ON STARTUP.

Copy

Replace it with this section

<connectionStrings>
    <add name="HostserverDB" connectionString="Data Source=SERVERNAME;Initial Catalog=K2HostServer;integrated security=sspi;Pooling=True" />
    <add name="SourceCode.MessageBus.Ews.ExchangeWebServicesConnection:administrator@denallix.com" connectionString="Autodiscover={True/False};Url={EWS URL,not supported if Autodiscover is True};User ID={Login User,optional};Password={Password,optional}" />
    <add name="SourceCode.Net.Mail.SmtpConnection:administrator@denallix.com" connectionString="Host Name={SMTP Server};Port={Port;Default 25};Tls={BootTls/None};Authentication={Windows/Plain};User ID={Login User,optional};Password={Password,optional}" />
    <add name="SourceCode.Net.Mail.SmtpConnection" connectionString="Host Name={SMTP Server};Port={Port;Default 25};Tls={BootTls/None};Authentication=Anonymous" />
</connectionStrings>

Edit the section to match your local environment settings and restart the server to re-encrypt the connectionStrings section.

Use the following guidelines for populating the connection strings manually:

  • Multiple accounts per origin (listener, e.g. Exchange Web Services) and destination (e.g. SMTP) are supported. Exchange is used for SmartActions and SMTP is used for sending non-SmartAction notifications.
  • Specify the type of connection using the connection string name, for example:
    • SourceCode.MessageBus.Ews.ExchangeWebServicesConnection:K2Service@Denallix.com 
    • The first portion (before ‘:’) of the name is the connection type.
    • The second portion (after ‘:’) is the account for the connection.
  • The accounts listed in the second portion are email addresses queried using the URM (user role manager) service. You can test these by making SmartObject calls using the UM* SmartObjects (UMGroup, UMLabel, UMRole, UMUser) located under All SmartObjects in the SmartObjects Services Tester tool.

In order to setup SmartActions in your K2 environment, Exchange Web Services (EWS) is required.