Route Microsoft 365 Outbound Mail Through Barracuda
Question details
Route outbound Microsoft 365 email through an on-premises Barracuda spam firewall for filtering.

- Product
- Microsoft 365 Exchange Online and Barracuda Email Security Gateway
- Device & OS
- not provided
- Scenario
- A hybrid Exchange organization wants messages sent to external recipients to pass through its Barracuda firewall.
- Observed behavior
- Outbound messages can bypass Barracuda, and a connector configured with only its public IP may fail validation or report DNS query errors.
Identify the Barracuda gateway's publicly reachable smart-host address and confirm that it accepts and relays outbound mail from Exchange Online. Check its DNS, SMTP access, and TLS certificate requirements, and ensure that its outbound route will not send the same messages back to Microsoft 365.
Create a Barracuda smart-host connector and mail-flow rule
Use this approach to direct selected outbound Exchange Online messages through Barracuda for filtering.
In the Exchange admin center, go to Mail flow > Connectors and select Add a connector. Set the connection from Office 365 to a partner organization, then name the connector.
Choose to use the connector when a transport rule redirects messages to it. Route email through a smart host and enter the Barracuda gateway's publicly reachable address, preferably a DNS-resolvable hostname. Configure TLS to match the gateway's supported settings and certificate.
Use the connector validation screen to test delivery to an external recipient. If validation reports a DNS or connection error, check the smart-host address, public DNS, SMTP access, and Barracuda relay settings before retrying.
Go to Mail flow > Rules and add a rule. Set conditions for messages sent from inside the organization to recipients outside the organization, then choose the action to redirect the messages to the Barracuda connector. Add any exceptions needed to avoid routing loops.
Send a message from a Microsoft 365 mailbox to an external address. Check Exchange Online message trace and Barracuda logs to verify that the message passed through the gateway and was delivered.

Review centralized mail transport in a hybrid deployment
Consider this alternative when outbound Microsoft 365 mail should first pass through on-premises Exchange.
Use WPS Office for everyday document work
WPS Office is a free, lightweight alternative for creating and editing office files, with a familiar interface that makes it easy to move existing documents. It does not configure Exchange Online connectors or Barracuda mail routing.

Frequently Asked Questions
Why does the Barracuda connector report a DNS query error?
Check the smart-host address in Exchange admin center > Mail flow > Connectors. If you use a hostname, confirm that it resolves publicly to the Barracuda gateway and that the gateway accepts SMTP connections from Exchange Online.
Why is outbound mail still bypassing Barracuda?
A connector scoped to a transport rule is used only when a matching rule redirects the message to it. Check the rule under Mail flow > Rules, including its sender, recipient, action, and exception settings, then verify the path in message trace and Barracuda logs.
Does centralized mail transport automatically filter mail through Barracuda?
No. Centralized mail transport sends applicable outbound cloud mail through on-premises Exchange. The on-premises outbound connector must also route that mail through Barracuda.
How can I inspect the outbound connector settings?
In Exchange Online PowerShell, run Get-OutboundConnector -Identity "Connector name" | Format-List to review properties such as SmartHosts, UseMXRecord, and IsTransportRuleScoped. Also check the configured TLS settings against the Barracuda gateway.




