# Exchange Online

# SMTP blocked when using direct send or SMTP relay

When attempting to set up direct send or an SMTP relay (i.e. sending email without using SMTP authentication), you may encounter the SMTP error message:

`550 5.7.1 Service unavailable, Client host [a.b.c.d] blocked using Spamhaus`

If the IP address (or range is static), you can allow the connection by adding the IP address to the connection filter policy under the IP Allow List in [Anti-Spam policies ](https://security.microsoft.com/antispam)on the Microsoft Defender portal.

If the IP address doesn't show in the allow list after adding via the UI or you prefer Powershell. Connect to Exchange Online Powershell and run

`Set-HostedConnectionFilterPolicy -Identity Default -IpAllowList <em>IPAddressOrRange</em>`

This may take a few minutes to take effect.