Network Ports and Firewall Requirements for Exchange Server SE, 2019 & Hybrid Deployments

Designing a secure, resilient enterprise network architecture for Exchange Server Subscription Edition (SE), Exchange 2019, or Exchange Online Hybrid requires a crystal-clear understanding of required network ports.

A single blocked port or an unconfigured RPC dynamic range between your Mailbox servers, Domain Controllers, or perimeter Edge Transport servers can break mail flow, prevent database failovers in a Database Availability Group (DAG), or cause mysterious Outlook connectivity prompts.

In this updated guide, we provide a complete, path-by-path firewall port matrix, an architectural flow diagram, and a PowerShell connectivity testing script for your pre-flight validation.


Microsoft's Core Rule for Internal Exchange Networks

Critical Rule: Microsoft does not support restricting, filtering, or altering network traffic via internal firewalls between internal Exchange Mailbox servers in the same organization. Internal Exchange servers require open, unrestricted RPC and IP communication with each other and with Active Directory Domain Controllers.

If an internal firewall must sit between Exchange servers and your corporate LAN, DMZ, or Microsoft 365, use the port matrices below.


Architectural Network Flow Diagram

Exchange Server Network Communication Boundaries
Corporate LAN · Clients
Outlook / Mobile / Web
  • HTTPS 443 – MAPI/HTTP, OWA, EWS
  • SMTP 587 – Authenticated relay
  • IMAP 993 / POP 995 – Legacy (if used)
Internal Core · Mailbox Servers
Exchange SE / 2019 DAG
  • SMTP 25 – Inter-server transport
  • TCP 3343 – Failover Cluster heartbeats
  • TCP 64327 – Static DAG log replication
  • SMB 445 – File Share Witness (FSW)
Perimeter · DMZ / Cloud
Edge Transport & M365
  • SMTP 25 – Internet mail / EXO connectors
  • TCP 50636 – EdgeSync secure LDAP
  • HTTPS 443 – Hybrid MRS & Free/Busy

1. Client-to-Exchange Mailbox Server Ports

These ports must be reachable from user workstations, mobile devices, and application relays to the internal or reverse-proxy Virtual IP (VIP):

Protocol / ServicePort / TransportDirectionPurpose
HTTPS443 / TCPClient → ExchangeAll modern client traffic: MAPI over HTTP, Outlook on the Web (OWA), EAC, Exchange ActiveSync (EAS), EWS, Autodiscover, and OAB downloads.
HTTP (Redirect)80 / TCPClient → ExchangeUsed solely to redirect plaintext http://mail.contoso.com requests to https://mail.contoso.com.
Authenticated SMTP587 / TCPClient → ExchangeClient submission for modern applications and multifunction printers (Client Frontend Receive Connector).
Secure IMAP4993 / TCPClient → ExchangeSecure IMAP4 over TLS (only required if IMAP4 service is enabled).
Secure POP3995 / TCPClient → ExchangeSecure POP3 over TLS (only required if POP3 service is enabled).

2. Exchange-to-Active Directory Domain Controller Ports

Exchange Mailbox servers query Active Directory constantly for directory lookups, authentication, and configuration routing. Ensure these ports are open to all DCs and Global Catalog (GC) servers:

ServicePort / TransportPurpose
DNS53 / TCP & UDPActive Directory and SRV record lookups (_autodiscover._tcp).
Kerberos88 / TCP & UDPUser and computer authentication.
RPC Endpoint Mapper135 / TCPEndpoint resolution for Active Directory RPC services.
SMB445 / TCPGroup policy retrieval and domain communication.
LDAP389 / TCP & UDPActive Directory queries.
LDAP SSL636 / TCPSecure Active Directory queries.
Global Catalog (GC)3268 / TCPForest-wide address book and recipient lookups.
Global Catalog SSL3269 / TCPSecure forest-wide Global Catalog lookups.
RPC Dynamic Ports49152–65535 / TCPDynamic RPC ports negotiated via Endpoint Mapper for AD replication and Netlogon.

3. Inter-Server Ports within a Database Availability Group (DAG)

When Exchange servers replicate transaction logs or manage cluster heartbeats inside a DAG:

ServicePort / TransportDirectionPurpose
SMTP Transport25 / TCPMailbox ↔ MailboxRouting messages between mailbox servers.
Cluster Service3343 / TCP & UDPMailbox ↔ MailboxWindows Server Failover Cluster (WSFC) health heartbeats.
File Share Witness445 / TCPMailbox → FSW ServerAccessing the cluster quorum file share witness.
Log ReplicationDynamic or 64327 / TCPMailbox ↔ MailboxContinuous Replication of transaction logs. By default, uses RPC dynamic ports. Can be statically pinned using Set-DatabaseAvailabilityGroup -ReplicationPort 64327.

4. Edge Transport (DMZ) & EdgeSync Ports

If you operate an Edge Transport server in your perimeter network (DMZ) to filter incoming and outgoing Internet email:

Communication PathPort / TransportPurpose
Internet → Edge Transport25 / TCPInbound Internet SMTP delivery.
Edge Transport → Internet25 / TCPOutbound Internet SMTP delivery.
Edge ↔ Mailbox Servers25 / TCPInternal SMTP transfer between Edge and internal Hub Transport.
Mailbox → Edge Transport50636 / TCPEdgeSync Secure LDAP: The internal Mailbox server pushes recipient and configuration updates outbound to the Edge server's Active Directory Lightweight Directory Services (AD LDS) instance.
Security Note: EdgeSync communication on port 50636 is strictly one-way outbound from internal Mailbox servers to the Edge Transport server. The Edge server never initiates connections back to internal AD or Mailbox servers on this port.

5. Exchange Online Hybrid Ports (Microsoft 365)

For coexistence and cross-premises communication with Exchange Online:

DirectionPort / TransportPurpose
Inbound from M36525 / TCPInbound hybrid mail flow from Exchange Online Protection (EOP) connectors.
Outbound to M36525 / TCPOutbound hybrid mail flow sent to *.mail.protection.outlook.com.
Inbound from M365443 / TCPInbound MRS (Mailbox Replication Service) proxy for mailbox migrations, hybrid free/busy lookups, and Autodiscover.
Outbound to M365443 / TCPOutbound calls to outlook.office365.com for OAuth authentication and cloud calendar availability.

Pre-Flight Verification Script (PowerShell)

Before deploying a new Exchange server or opening a firewall change request, run this diagnostic script to verify port connectivity from the Exchange server to target DCs, DAG peers, or Edge servers:

POWERSHELL
function Test-ExchangePortMatrix {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory = $true)]
        [string]$TargetHost,

        [Parameter(Mandatory = $true)]
        [ValidateSet("DomainController", "DAGPeer", "EdgeServer", "HybridClient")]
        [string]$Role
    )

    $portProfiles = @{
        "DomainController" = @(53, 88, 135, 389, 445, 636, 3268, 3269)
        "DAGPeer"          = @(25, 135, 445, 3343)
        "EdgeServer"       = @(25, 50636)
        "HybridClient"     = @(80, 443, 587)
    }

    $portsToTest = $portProfiles[$Role]
    Write-Host "[*] Testing port connectivity from $env:COMPUTERNAME to $TargetHost (Profile: $Role)..." -ForegroundColor Cyan

    $results = foreach ($port in $portsToTest) {
        $test = Test-NetConnection -ComputerName $TargetHost -Port $port -WarningAction SilentlyContinue
        [PSCustomObject]@{
            TargetHost  = $TargetHost
            Port        = $port
            TcpTestOpen = $test.TcpTestSucceeded
            LatencyMs   = $test.PingReplyDetails.RoundtripTime
        }
    }

    $results | Format-Table -AutoSize
    return $results
}

# Example Usage:
# Test-ExchangePortMatrix -TargetHost "dc01.contoso.com" -Role DomainController
# Test-ExchangePortMatrix -TargetHost "ex02.contoso.com" -Role DAGPeer
# Test-ExchangePortMatrix -TargetHost "edge01.contoso.com" -Role EdgeServer