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.
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 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.
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.
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.
Each EWS connection is resolved when the server starts. Multiple accounts are supported but it is recommended that you have only one. The connection string has the following format:
Autodiscover={True/False};Url={EWS URL,not supported if Autodiscover is True};User ID={Login User,optional};Password={Password,optional};Poll Interval={Optional, Default 30S}
- User ID and Password are optional.
- Url is required if Autodiscover is “False”.
- Url is not supported if Autodiscover is “True”.
Valid Connection String Examples
<connectionStrings>
<add name="HostserverDB" connectionString="Data Source=SERVERNAME;Initial Catalog=K2HostServer;integrated security=sspi;Pooling=True" />
<add name="SourceCode.MessageBus.Ews.ExchangeWebServicesConnection:system@k2.local" connectionString="Autodiscover={True/False};Url={EWS URL,not supported if Autodiscover is True};User ID={Login User,optional};Password={Password,optional};Poll Interval={Optional, Default 30S}" />
<add name="SourceCode.Net.Mail.SmtpConnection:system@k2.local" 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>
String definitions:
- HostServerDB: The string for connecting to the server.
- ExchangeWebServicesConnection: This is the EWS string you would modify to set the polling interval.
- SmtpConnection 1: This is the authenticated SMTP account (a match is made according to email). You may add multiple accounts.
- SmtpConnection 2: This is the fallback account in case a direct account match is found. In 90% of cases it should be anonymous (SMTP relay).
Poll Interval: You can use S, M, H, D for the units (seconds, minutes, hours, days respectively). Remember that if you manually update the connection strings you need to replace the existing connectionStrings element which is encrypted. It is also recommend that you keep a backup of what you paste in as the section automatically gets encrypted when the server starts. Remember that the poll interval is also ignored if the previous check resulted in mail – it only comes into play when a check for mail returned nothing.