Skip to content

/config/exchange-online/forwardingsmtpaddress

Set-Mailbox -ForwardingSmtpAddress and -DeliverToMailboxAndForward (mail forwarding)

The commands on this page have not been executed by our verification runner yet.updated
tool
Exchange Online PowerShell
file
Mailbox object (Set-Mailbox)
key
ForwardingSmtpAddress
type
ProxyAddress (smtp:address)
default
$null (no forwarding)

ForwardingSmtpAddress is the mailbox property that forwards incoming mail to another SMTP address, typically an external one. DeliverToMailboxAndForward decides whether the mailbox keeps a copy. Set both in one command:

powershell
Set-Mailbox -Identity john@contoso.com -ForwardingSmtpAddress "smtp:manuel@fabrikam.com" -DeliverToMailboxAndForward $true

Without -DeliverToMailboxAndForward $true (the default is $false), mail is only forwarded and nothing stays in the mailbox. Connect with Connect-ExchangeOnline first; the Recipient Management role group can run Set-Mailbox.

Forwarding properties

PropertyTypeMeaning
ForwardingSmtpAddressProxyAddressAny SMTP address, not validated; usually external
ForwardingAddressRecipientA recipient in your organization (mailbox, mail user, contact)
DeliverToMailboxAndForwardBoolean, default $false$true delivers to the mailbox and forwards; $false only forwards

If both ForwardingAddress and ForwardingSmtpAddress are set, ForwardingSmtpAddress is ignored and mail goes to the ForwardingAddress recipient.

Check and remove forwarding

powershell
Get-EXOMailbox -Identity john@contoso.com -Properties ForwardingSmtpAddress,ForwardingAddress,DeliverToMailboxAndForward |
  Format-List ForwardingSmtpAddress,ForwardingAddress,DeliverToMailboxAndForward

Set-Mailbox -Identity john@contoso.com -ForwardingSmtpAddress $null -ForwardingAddress $null -DeliverToMailboxAndForward $false

To find every mailbox that forwards somewhere:

powershell
Get-EXOMailbox -ResultSize Unlimited -Properties ForwardingSmtpAddress,ForwardingAddress |
  Where-Object { $_.ForwardingSmtpAddress -or $_.ForwardingAddress } |
  Select-Object UserPrincipalName,ForwardingSmtpAddress,ForwardingAddress

Forwarding is set but external mail is not forwarded

Exchange Online can block automatic external forwarding independently of this property. The outbound spam filter policy controls it (Get-HostedOutboundSpamFilterPolicy | Format-List Name,AutoForwardingMode): On allows automatic external forwarding, Off blocks it, and the default Automatic behaves as Off in most organizations since 2021. Remote domain settings can also stop it. When the policy blocks forwarding, the sender receives a non-delivery report; trace the message with Get-MessageTraceV2 to see it.

Sources