Articles in this section

PowerShell Script - Configure Connectors and Mail Flow Rule for Templafy-Hosted Email Signature Server

About this article

This article contains instructions for using a PowerShell script to automatically configure Microsoft 365 Exchange Online with the Templay-Hosted Email Signature Server. The steps will create and configure a mail flow rule and connectors in the Exchange Online Admin Center that will identify the e-mails that will be redirected through the Templafy Email Signature Server cluster for processing.

Prerequisites

 
  • Global Admin rights in Exchange Online Admin Center

 

 

Install Module and Connect to Exchange Online

Open PowerShell and Run the following commands in order:

  1. Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.4.0

  2. Import-Module ExchangeOnlineManagement

  3. Connect-ExchangeOnline -UserPrincipalName [insert email address used to login to Exchange Online]

 

Create the Connectors

Replace [tenant-name] with the unique name of the Templafy tenant in production.

 

Inbound Connector:

New-InboundConnector -Name "templafy-ess-inbound-cert"-ConnectorType OnPremises
-TlsSenderCertificateName [tenant-name].templafy-ess.com -RequireTls $true
-CloudServicesMailEnabled $true

 

 
  • The following dialogue will appear:
    • Supply values for the following parameters:
      SenderDomains:
    • Include each email domain (comma separated) that is configured in your Templafy tenant Email Signatures Settings.

 

Outbound Connector:

New-OutboundConnector -Name "templafy-ess-outbound-cert" -ConnectorType OnPremises
-IsTransportRuleScoped $true -TlsSettings DomainValidation -TlsDomain
[tenant-name].templafy-ess.com -UseMXRecord $false -SmartHosts [tenant-name].templafy-ess.com
-CloudServicesMailEnabled $true

 

Validate the Outbound Connector

Outbound connector validation is required for Exchange Online to trust the connectors.

Set-OutboundConnector -Identity "templafy-ess-outbound-cert" -IsValidated $true
-LastValidationTimestamp (Get-Date).ToUniversalTime()

 

Create the Mail Flow Rule

Replace the following values in the command below:

  • [organization-domain] - include each email domain (comma separated) that is configured in your Templafy tenant Email Signatures Settings.
  • [test-user] - the email address of each user that the rule will apply to in order to test the server (comma separated).
  • [guid] - GUID value that is provided by your Templafy Solutions Engineer on this implementation.
New-TransportRule -Name "templafy email signatures" -FromScope InOrganization 
-SenderDomainIs [organization-domain] -From [test-user] -RouteMessageOutboundConnector
"templafy-ess-outbound-cert" -SetHeaderName "Templafy-EmailSignatureServer-Secret"
-SetHeaderValue [guid] -ExceptIfHeaderContainsMessageHeader
"Templafy-EmailSignatureServer-Processed" -ExceptIfHeaderContainsWords "true"
-ExceptIfHeaderMatchesMessageHeader "x-processedbytemplafy" -ExceptIfHeaderMatchesPatterns
"true" -ExceptIfMessageTypeMatches PermissionControlled -ExceptIfMessageSizeOver 153600KB
-StopRuleProcessing $true -Priority 0 -Enabled $false

 

 

Related articles

 
email signature server Templafy-Hosted connector Exchange
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.