Many email providers are moving away from basic authentication in favor of an OAuth2 implementation. Where basic auth uses a username/password combination, OAuth2 has a more involved process involving a client ID and a client secret, plus an additional authorization step that generates a token that gets used behind the scenes. It's considered a more secure form of authentication.
Because OAuth2 is more involved, we're building out SMTP support for it based on customer request.
KnowledgeOwl currently supports Microsoft OAuth2 SMTP. If you need us to set up another SMTP provider's OAuth2 authorization flow, please contact us and let us know the provider--we will add new providers based on customer interest.
We've tested our OAuth2 configuration with the Azure Portal.
You will need your IT administrator to set up the Microsoft/Azure side of SMTP. We'd also recommend either giving them direct access to configure our side of the SMTP setup, or making sure you have time set aside to work with them to get things set up in KnowledgeOwl properly.
Resources for the Microsoft/Azure admin
- You'll need to create an app on the Microsoft side to handle these requests. We found this Microsoft documentation helpful as a starting place:
- You'll also need to have at least one active email account that can be used by that app. This user account must have the Authenticated SMTP permission in Mail > Email Apps.
- Here are the settings we used for our app, though you may want to tweak for your setup:
- Single tenant app registration OR Multi-tenant app registration
- Under redirect URI, add a Web URI for
https://app.knowledgeowl.com/oauth2/custom-smtp-token
- In API permissions, we used Microsoft Graph > delegated permissions and used these permissions:
- Mail.Send
- Mail.Send.Shared
- SMTP.Send
- The app you create will need to go through an authorization process within KnowledgeOwl, initiated by a user of your organization. You will need to use Power Shell to set that user's value for
SmtpClientAuthenticationDisabled
tofalse
. (See the official Microsoft documentation for more details: Enable or disable authenticated client SMTP submission (SMTP AUTH) in Exchange Online.) - On the KnowledgeOwl side, you'll need to provide:
- The email address that should be used--this should be the email account mentioned in step 1 above.
- The Client ID, listed as the Application or Client ID
- If you're using Azure Portal, this is the Application (client) ID listed on the App registration's Overview page
- The Client Secret Value
- If you're using Azure Portal, you can generate this in the App registration's Certificates & secrets
- In our testing, we were only able to have one active secret connecting to KO within the app; adding additional secrets failed.
- If using a Single Tenant app, the Tenant ID listed on the App registration's Overview page
If you are using Azure SMTP within an app, it will only send to email addresses within your Azure organization (single tenant) or with a valid Microsoft email (multitenant). This setting can be configured in Authentication > Supported account types in Azure.
KnowledgeOwl setup
Once you have the Azure app and email account set up and a client secret generated, you can begin setting up your new SMTP service in KnowledgeOwl. To do so:
- Click on your profile icon/name in the upper right.
- Select SMTP from the dropdown.
- Select the + Configure New Service button.
- This will open the Create SMTP Service page:
- Add a Friendly Name. This is the name that will be displayed in SMTP dropdowns for individual features, so it should describe the SMTP service in some way.
- Add the SMTP Host. This is the address your email server provides for the SMTP host. For Microsoft, use
smtp.office365.com
unless your IT admin tells you otherwise. - Add the Port. Most providers will have specific recommended ports. Unless your IT admin tells you otherwise, use
587
. - Add the Send From Address. The email address that will show up in the "From" field for all emails sent using this SMTP service. This should be a valid email address in your Microsoft organization.
- Optional: Add a Reply To Address. This allows you to specify a Reply-to address different from the Send From Address.
- Optional: Add a Send From Name. This is the name that will show up in the "From" field for any emails sent using this SMTP service.
- In the Authentication section, select OAuth2 to configure your SMTP using OAuth2.
- Select Microsoft as the provider.
- Add the Login Email that will be used to authenticate. This needs to be an account that has permissions to send email.
- Add the Client ID from your app. In Azure Portal, this is the Application (client) ID listed on the App registration's Overview page.
- Add the Client Secret from your app. In Azure Portal, you can generate this in the App registration's Certificates & secrets page.
- If you are using a Single Tenant app, add the Tenant ID for your app. In Azure Portal, this is the Tenant ID listed on the App registration's Overview page.DO NOT ENTER A TENANT ID IF YOU ARE USING A MULTI-TENANT APP.
- Once you've finished completing all fields, click Create.
- Once you have created the service, you must Authorize that service. This uses the information you previously entered to perform the OAuth2 authorization flow and get the token we need to authenticate. To begin authorization, select the Authorize button.
- If there are any issues authorizing your SMTP service, an error message will appear in the lower left. This message will contain a link to the error code we received back from Microsoft; you can click that link to get more details on what caused your authorization to fail. You'll want to review this error code with your IT admin:
- If there are any issues authorizing your SMTP service, an error message will appear in the lower left. This message will contain a link to the error code we received back from Microsoft; you can click that link to get more details on what caused your authorization to fail. You'll want to review this error code with your IT admin:
- When the authorization completes successfully, a confirmation message will slide out in the lower left. Once you see that message, continue to the next step:
- Once you get the authorization successful message, click the Send Test Email to fully confirm the SMTP is configured properly. We strongly recommend doing this to confirm that emails are sending properly. (Note that Azure will expect you to send this to an email within your own organization.)
- If your authorization completed successfully, the test email should go through and show you a confirmation message. At this point, your SMTP is ready to use!
- If for any reason your test email fails:
- Try re-authorizing the service. Make sure you get a confirmation message.
- Be sure the test email you're sending is part of your organization's Azure platform. Azure SMTP cannot be used to send emails to external services.
- Be sure that your Microsoft admin has run the Power Shell command to set the account you're authorizing the app with to have
SmtpClientAuthenticationDisabled
set tofalse
.
Once you have sent a successful test email, your SMTP service should now be available for use.
You can add it to:
- Any knowledge base's Subscription settings
- Your account's Reader emails for reader welcome and password reset emails
KnowledgeOwl IP Address
If you need to set up an exception for these communications with your SMTP provider, see Required IP addresses for more details.