FortiMail & Office 365 Integration Guide

FortiMail & Office 365 Integration Guide

FortiMail & Office 365 Integration Guide

Your step-by-step checklist for configuring DNS and O365 mail flow.

1 Public DNS Record Changes

MX Record

Point your domain's email to FortiMail for initial processing. This directs all incoming mail to your new secure gateway.

Old Value:

yourdomain-com.mail.protection.outlook.com

New Value:

mail.yourdomain.com

(Your FortiMail's public FQDN or IP)

SPF Record

Authorize FortiMail as a valid sender for your domain to prevent your emails from being marked as spam.

Existing Record:

v=spf1 include:spf.protection.outlook.com -all

Updated Record (Add FortiMail IP):

v=spf1 ip4:your_fortimail_public_ip include:spf.protection.outlook.com -all

2 Office 365 Exchange Admin Center

Inbound Connector

Create a rule to trust emails that have been processed by your FortiMail appliance.

  1. Go to Mail flow > Connectors and click Add a connector.
  2. Set Connection from: to Partner organization.
  3. Name the connector (e.g., FortiMail Inbound).
  4. Authenticate by verifying the sender's IP address, and add your FortiMail's public IP.
  5. For security, enable "Reject email messages if they aren't sent over TLS".

Outbound Connector

Configure O365 to route all outgoing mail through FortiMail for scanning.

  1. Create a new connector with Connection from: Office 365 and Connection to: Partner organization.
  2. Name the connector (e.g., FortiMail Outbound).
  3. Under "Use of connector", select "Only when I have a transport rule...".
  4. Route emails to a smart host: add your FortiMail's FQDN or public IP.
  5. Configure TLS security settings as required.

Mail Flow Rule

Create the transport rule that activates the outbound connector for all outgoing messages.

  1. Go to Mail flow > Rules and create a new rule.
  2. Name the rule (e.g., Route Outbound via FortiMail).
  3. Set Apply this rule if... to The sender is located 'Inside the organization'.
  4. Set Do the following... to Redirect messages to... the outbound connector you just created.
  5. Important: Add an exception to prevent mail loops. The exception should be if a Received message header includes your FortiMail's hostname.