Enabling Sending Emails to KanBo (Microsoft 365 + Azure)

Table of Contents

Overview

The Send Email to KanBo feature allows you to send emails directly to a space and create a new card from the email. It is also possible to send an email and its attachments to an existing card.

For more information, see the article about sending emails to cards and spaces.

Prerequisites

  • This functionality requires a service account on your Microsoft 365 account that serves as a catch-all account. The Microsoft 365 user must have at least an Exchange Online license.
  • Set up an email account with a custom domain. Learn how to do so with Microsoft 365 here: Add a custom domain to Microsoft 365. When you are ready to proceed with a custom domain, create a service account using this domain for the email address (e.g., mails@yourdomain.com)

Installation

1. Creating a catch-all email address

To create a catch-all email account in your Exchange Online:

  1. In the Microsoft 365 Admin Center, create a new account for catch-all purposes only.
  2. Assign an Exchange Online license to this account. Read more here about assigning Microsoft 365 licenses to users.
  3. Add the accepted domain to your Microsoft 365.
  4. Go to Microsoft 365, and then select Admin > Exchange.
  5. In the Exchange admin center, choose the Email flow.

  1. Select Accepted Domains, then select your domain, and select the Edit button.

  1. Change the accepted domain from “Authoritative” to “Internal Relay,” and then select Save.

  1. Open the Mail flow section.
  2. Select the Rules section, and then select + button > Create a new rule.
  1. Select More options… at the bottom of the page. Name this rule “CatchAll”.

  1. Set the following properties to the rule:
    • “Apply this rule if…” > “A recipient’s domain is” and add your domain.
    • “Do the following…” > “Redirect the message to” and choose your catch-all email account from the User Picker.
    • In “Do the following…” select Add action, and then select “Set the message header to this value…” and “Set the message header ‘X-CatchAll-Rule’ to value ‘Yes‘.
    • “Except if…” >  “The recipient is…” and select your catch-all email account from the User Picker.
  1. Select Save.

2. Enabling incoming emails in the KanBo appsettings.json file

  1. Go to the KanBo appsettings.json file and set "KanBoIncomingMail" to "true".
"IncomingMail": true,

  1. Set KanBoIncomingMailDomain to your sending domain name - the one on which you have the catch-all mailbox.

"IncomingMailDomain": "yourdomain",

  1. Save the appsettings.json file.


3. Azure AD permissions

Make sure all the necessary permissions are present in Azure AD:

  1. Go to Azure AD, and then in App registrations, find your KanBo registration.
  1. Go to API Permissions, and then select + Add a permission.
  2. Select Microsoft Graph.
  1. Select Delegate and the following permissions:
  • OpenID permissions > email,
  • Mail > Mail.Read and Mail.ReadWrite.
  1. Save it. Follow the process; this time select Application permissions.
  2. Here, add Mail > Mail.Read and Mail.ReadWrite.
  1. Once added, grant admin consent.

5. Configuring the email tool

  1. If you do not have the KanBo.JobHost.zip package, contact us at support@kanboapp.com to receive it.
  2. After downloading the package, extract it and move it to a chosen location.
  3. Open your directory and begin editing the appsettings.json file.
  4. Change the beginning of the file (up to “NLog”) to the following:
{
 "AllowedHosts": "*",
 "ConnectionStrings": {
  "KanBo": "KANBOCONNECTIONSTRING"
 },
 "KanBo": {
  "config": {},
  "assemblies": [],
  "plugins": [
    "load-packages",
   {
    "type": "package",
    "name": "kanbo-api",
    "thumbprint": "KANBO-CERTIFICATE-THUMBPRINT",
    "url": "https://KANBOURL"
   },
   {
    "type": "package",
    "name": "auth-aad",
    "client-id": "KANBO-CLIENT-ID",
    "tenant": "KANBO-TENANT-ID",
    "thumbprint": "KANBO-CERTIFICATE-THUMBPRINT"
   },
   {
    "type": "job.incoming-mail",
    "incoming-mail-domain": "MAIL-DOMAIN",
    "children": [
     [
      "mailbox",
      {
       "type": "graph",
       "email": "USER@MAIL-DOMAIN"
      }
     ]
    ]
   }
  ]
 },
  1. Adjust the uppercased values according to your KanBo app settings.json file and the previous steps.
  2. Save the changes.

6. Adding an Azure App WebJob

  1. Zip up the “EmailToKanBo” folder (the package you were working on in the previous steps).
  2. Go to your Azure App > WebJobs.
  3. Select + Add.
  1. Select:
    • Name: your custom name,
    • File upload: the .zip of the “EmailToKanBo” package, already configured,
    • Type: Triggered,
    • Triggers: Scheduled,
    • CRON Expression: For information regarding CRON on Azure, see this guide.

You have finished configuring and installing the Incoming Mails feature.

7. Using the Send Emails to KanBo feature

Recommendation: Set an Outlook retention policy to remove old messages

To avoid clogging up your email notifications mailbox, set a simple rule to clean out messages older than a week.

  1. As an Exchange administrator, go to the Exchange Admin Center > Compliance Management > Retention Tags.
  2. Create a new rule that is applied automatically to a default folder.
  1. Find a name and select this tag to apply it to the Inbox only. Then, choose a retention period of 90 days.
  1. Go to Retention policies and create a new retention policy to which this tag has been assigned.
  1. Go to Recipients, select your Incoming Mails account, and then in Mailbox features, select your newly created Retention Policy.

Was this article helpful?

Please, contact us if you have any additional questions.