Recently someone had been in touch with a forum with a strange issue.
One of their office 365 users had an e-mail mailbox, brand new, that was somehow forwarding messages to a gmail account when they came in.
The powershell command
Get-Mailbox -Filter {ForwardingAddress -ne $null}
gave a list of no accounts being forwarded. The OWA interface for the user also didn’t show any forwarding rules.
The forum ran out of ideas and the user contacted Microsoft Support.
Microsoft solved the problem with the following advice:
- To disable forwarding to other email address from Office 365 for one user
- Set-Mailbox -Identity “UsersEmailAddress” -ForwardingAddress:$null -ForwardingSmtpAddress:$null
- To do this for all users in Office 365
- Get-Mailbox | Set-Mailbox -ForwardingAddress:$null -ForwardingSmtpAddress:$null
- To check if it has set properly (for one user)
- Get-Mailbox -Identity “UsersEmailAddress” | Select DisplayName, ForwardingAddress, ForwardingSmtpAddress
- To check if it has set properly (for all users)
- Get-Mailbox | Select DisplayName, ForwardingAddress, ForwardingSmtpAddress
I can’t check what state the account must have been in but I assume the ForwardingAddress waas blank but ForwardingSmtpAddress may not have been.