Mail Distribution Service

Local SMTP vs Local Distribution vs Cloud Distribution


Local SMTP

The local SMTP service should be used in environments where the client has their own internal SMTP relay.

It should be noted that the local SMTP service cannot attempt retries of sends if it initially fails, however, this typically only occurs on edge cases.

Local Distribution

The local distribution service should be used where a client has their own internal SMTP relay, but desires additional confirmation and retention in the case of failures.

Note that while this can be done if the clients internal security allows it, using the cloud hosted distribution is a far simpler solution.

Cloud Distribution

The cloud distribution service should be used in environments where the client does not have an internal SMTP server and needs to send emails. This an be configured to use the secure KeyMark SMTP relay, which has been tooled to be compatible with the distribution server.

Setup


Local SMTP

On any FiM 20+ install the local SMTP distribution will already be included, any other versions will need to update.

  • To install the local SMTP distribution update, run the newest FormsInMotion server and client installers which can be found in \\km-ftp\FTP\Download\FormsinMotion\Install\

  • It is recommended that the port setting be changed to 0 so that the mail service can automatically obtain its secure connection.

Local Site Settings

  • Note: do not create the the DistributionServerPath variable, if you wish to use the local distribution method.

Setting

Description

Example

Setting

Description

Example

SmtpFrom

The email that the smtp server will send the value with

forms-in-motion-no-reply@formsinmotion.com

SmtpPassword

The password that the SMTP server will use to connect

p@55w0rd

SmtpPort

The port that the SMTP server will use to connect.
In most cases the value should be zero (0) for this property, as the distribution API can intuit the correct port without the user's assistance.

value in range 0 - 65536

SmtpServer

The Smtp server that the mail distribution API will connect to.
This should be your local Smtp Relay

smtp.local-nework-serve.net

SmtpSsl

whether or not the message should be use the Secure Socket Layer protocol. Setting this to true is highly recommended

true or false

SmtpUser

the username that will be used to authenticate with the email account

conner.phillis@formsinmotion.com

Local Distribution

Installing The .NET Core Compatibility Pack

  • The Distribution API uses Microsoft's modern web API toolkit, ASP.NET  Core v3.1. Unfortunately, this is not supported natively by IIS v11, so a compatibility pack must be installed.

  • The compatibility pack can be download from this page  or downloaded directly from this link 

Adding The Distribution API to IIS

  • Note: Should only be performed by KeyMark Employees*

  • When the .NET Core compatibility pack has been installed in IIS, simply drag the installation files in to the desired folder in IIS, and convert the folder to an application. Ensure the application has been mapped to the desired URL. To get installation files pull FormsInMotion.MailDistribution Branch Master and build.

Verifying Your Distribution API Installation

  • When the API has been converted to an application, and the URL is mapped the installation can be verified by navigating to {clientUrl}/Documentation/.

  • Map the URL by selecting the application, then clicking on "bindings" on the right hand side.

  • If your server has been setup correctly, you should see a list of API endpoints with their documentation.

Configuration

  • Mail Distribution is configured in the appsettings.json file, found in the mail distribution install location.

  • Distribution: General settings for the distribution service

    • RetryFactors: is how long the mail distribution will wait (in minutes) between each attempt to resend a failed message.

      • Note that this should always contain one less entry than the MaxSendAttempts as the first attempt will always be instant.

  • Purge: General settings for the purge service

    • PurgePeriodInHour: Number of hours that a successfully sent email will be retained before getting purged.

    • MaxFailedMessages: how many failed messages can be in the distribution service at any given time. After failed messages pass this number, the oldest failed messages will begin to be deleted, keeping the number of failed messages within the MaxFailedMessages.Utilizing the Local/Cloud Distribution Server

  • To enable the FormsInMotion Server to send to a distribution server, simply add a site property called DistributionServerPath and enter the URL for the distribution API.

    • FiM Cloud hosted path: https://maildistribution.app.formsinmotion.com

  • To disable this functionality, simply clear the URL, leaving the property blank.

Setting

Description

Example

Setting

Description

Example

DistributionServerPath

The path to the distribution API

https://maildistribution.app.formsinmotion.com

SmtpFrom

The email address that the smtp server will use to send the email

forms-in-motion-no-reply@formsinmotion.com

SmtpPassword

The password that the SMTP server will use to connect

p@ssw0rd

SmtpPort

The port that the SMTP server will use to connect.
In most cases the value should be zero (0) for this property, as the distribution API can intuit the correct port without the user's assistance.

value in range 0 - 65536

SmtpServer

The Smtp server that the mail distribution API will connect to.
From this point you can connect to our recommended secure KeyMark SMTP relay.

smtp.hosted-server.net

SmtpSsl

whether or not the message should be use the Secure Socket Layer protocol. Setting this to true is highly recommended

true or false

SmtpUser

the username that will be used to authenticate with the smtp account

conner.phillis@formsinmotion.com

SmtpFailureAddress

The administrator email(s) that will be used to send out notifications if an email fails to send. Delimiter for multiple emails is “;”

austin.w.graham@formsinmotion.com

SmtpFailureServer (optional)

When sending notification of failure the Mail Distribution defaults to sending to the KM SMTP relay however this can be configured here.

forms-in-motion-no-reply@formsinmotion.com

SmtpFailurePort (optional)

defaults to 0 but can be configured here if needed.

0

SmtpFailureUsername (optional)

Username used to authenticate with the SmtpFailureServer provided

myfailureusername

SmtpFailurePassword (optional)

Password used to authenticate with the SmtpFailureServer provided

myfailurepassword

Miscellaneous


Hosted API can be view maildistribution.sandbox.formsinmotion.com/index.html

Cloud distribution installer built from FormsInMotion.MailDistribution - Master