Exchange Online mail flow setup

Configure the on-premises mail gateway to deliver incoming mail to Exchange Online and relay outgoing mail through the tenant’s Exchange Online service.

Domainklientas.lt
Exchange Online endpointkientas-lt.mail.protection.outlook.com
SMTP port25
Connection securitySTARTTLS
Gateway public IP2.59.170.190

Confirm that 2.59.170.190 is the public IP address that Exchange Online sees when the gateway connects.

1. Find the Exchange Online endpoint

  1. Sign in to the Microsoft 365 admin center at admin.microsoft.com.
  2. Open Show all → Settings → Domains and select klientas.lt.
  3. Open the DNS records tab. Under Microsoft Exchange, select the MX record.
  4. Copy its Points to address or value. Use that exact hostname as the Exchange Online endpoint and gateway smart host.

The endpoint shown in the table above is kientas-lt.mail.protection.outlook.com. Confirm that it matches the value displayed for your domain before configuring the gateway.

2. Configure the gateway

Set the gateway’s smart host to kientas-lt.mail.protection.outlook.com on port 25, with STARTTLS enabled. Ensure the gateway can make outbound TCP connections on port 25.

3. Create the SMTP relay connector

In the Exchange admin center, open Mail flow → Connectors → Add a connector.

  1. Set Connection from to Your organization’s email server and Connection to to Office 365.
  2. Name the connector Gateway SMTP relay and turn it on.
  3. Select authentication by the sending server’s IP address.
  4. Enter 2.59.170.190 and save.

This connector allows the gateway to send mail through Exchange Online to external recipients. The SMTP envelope sender domain must be an accepted domain in the tenant.

4. Create the incoming mail restriction connector

Add a second connector in Mail flow → Connectors.

  1. Set Connection from to Partner organization and Connection to to Office 365.
  2. Name the connector Accept mail only via gateway and turn it on.
  3. Apply the connector to all sender domains (*).
  4. Restrict accepted connections to 2.59.170.190.
  5. Require TLS if the gateway is configured to use it, then save.

If all incoming internet mail must pass through the gateway, point the domain’s public MX record to the gateway. The gateway then forwards the mail to the Exchange Online endpoint. Add every public IP the gateway may use to the connector.

5. 4logist configuration

  • Use the tenant’s Exchange Online service as the SMTP relay. For example, set the SMTP server to kientas-lt.mail.protection.outlook.com for klientas.lt.
  • Connect on port 25 with STARTTLS enabled.

Was this helpful?

0 / 0