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.
- Install Module and Connect to Exchange Online
- Create the Connectors
- Validate the Outbound Connector
- Create the Mail Flow Rule
Prerequisites
|
Install Module and Connect to Exchange Online
Open PowerShell and Run the following commands in order:
-
Install-Module -Name ExchangeOnlineManagement -RequiredVersion 3.4.0
-
Import-Module ExchangeOnlineManagement
-
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
|
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
Comments
Article is closed for comments.