Hidden inbox rules and mail forwarding in Microsoft 365: how to find them in an hour and when to block external forwarding

· 7 min read · SilverData team

A customer calls your bookkeeper and asks whether the new bank account number on the last invoice is correct. The bookkeeper never sent any change. Her mailbox looks normal, because for weeks the customer's replies have been landing in the "RSS Feeds" folder, and a copy of every email containing the word "invoice" has been going to an unknown Gmail address.

This post lets you check in one hour whether your Microsoft 365 tenant runs rules and forwarding that nobody knows about. After reading it, you can also decide whether to block automatic external forwarding for the whole company, and which exceptions to keep.

Three places where forwarding hides

The first place is inbox rules. A user sets them in Outlook, or an attacker who has the user's password does. A rule created after a break-in rarely just forwards mail. It usually moves replies to a folder nobody opens (RSS, Archive, Conversation History), marks them as read, and has a name like "." or ".." so it does not stand out.

The second place is mailbox-level forwarding (so-called SMTP forwarding), set by an administrator. We typically see it after an employee leaves: someone forwarded the mailbox to the owner's private address "for a month", and it stayed that way for two years.

The third place is mail flow rules in the Exchange admin center, plus delegations, meaning another person's full access to a mailbox. Only an administrator can set these, so they are usually left over from the previous IT vendor, not from an attack.

Microsoft describes how attackers use rules in its documentation (source: Microsoft Learn — Outlook rules and custom forms injection). One point from that page matters: reinstalling Outlook or handing out a new laptop does nothing, because the rules are stored in the cloud mailbox.

How to check in an hour

You need an account with Exchange administrator rights and a Windows computer. You don't need to buy anything; everything is included in the Business Basic, Standard and Premium plans.

  1. In the Exchange admin center, open Reports → Mail flow → Auto forwarded messages report. It shows who has recently forwarded mail automatically to outside recipients, and to which domains (source: Microsoft Learn — Auto forwarded messages report).
  2. Install the ExchangeOnlineManagement module and connect with Connect-ExchangeOnline.
  3. List forwarding set on mailboxes: Get-Mailbox -ResultSize Unlimited | Where-Object {$_.ForwardingSmtpAddress -or $_.ForwardingAddress} | Select-Object Name, ForwardingSmtpAddress, DeliverToMailboxAndForward.
  4. List the rules of all mailboxes: Get-Mailbox -ResultSize Unlimited | ForEach-Object { Get-InboxRule -Mailbox $_.UserPrincipalName | Select-Object MailboxOwnerId, Name, ForwardTo, RedirectTo, MoveToFolder, MarkAsRead }. Save the output to a CSV file.
  5. Go through the list with someone who knows the team. In a 30-person company this usually takes 30–60 minutes.

What to look for in the output: forwarding to Gmail or to Polish free mail providers such as Onet and WP, or to unknown domains. Rules that move mail to RSS or Archive and mark it as read. Rules with words like "invoice", "transfer", "payment", "account" or "change" in their conditions (in Polish companies: "faktura", "przelew", "płatność", "konto"). Names made of dots or single letters.

If you find a rule nobody set up, don't delete it right away. Take a screenshot and an export, then disable the rule, reset the password, sign the user out of all sessions in the Microsoft 365 admin center, and check whether a new MFA method was added to the account. Then review the Sent Items folder for the past few weeks and call customers who may have received fake emails. We described the phone verification procedure for bank account changes in our post on supplier bank account change fraud.

Block external forwarding — yes or no

Automatic external forwarding is controlled by a setting in the outbound spam filter policy in the Microsoft Defender portal. There are three options: "Automatic - System-controlled", "On" and "Off". Microsoft itself writes that the default behaves differently depending on when your organization was created, and recommends setting "On" or "Off" explicitly (source: Microsoft Learn — control external email forwarding).

With "Off", every automatic forward to an outside address bounces back to the sender with error 5.7.520. This applies both to user rules and to forwarding set by an administrator. Forwarding inside the company keeps working.

You create exceptions in one of two ways. A separate outbound spam policy for two or three specific mailboxes, or a remote domain that allows forwarding to one domain only, for example your external accounting firm. When one setting allows and another blocks, the block usually wins.

Our recommendation for a company of 10–50 people: turn external forwarding off, and handle legitimate cases with exceptions on a named list. The cost is zero in licenses and usually 2–4 hours of work to map the exceptions.

What can go wrong

The block breaks everything that quietly relied on forwarding. Most often: a complaints@ or service@ mailbox forwarded to an external ticketing system, invoices@ forwarded to the accounting firm, a salesperson who reads mail on a private phone through Gmail. If you don't map these first, you will find out on Monday from your customers.

The block also does not stop an attacker who has the password and logs in to the mailbox directly. It does not stop rules that move mail to the RSS folder inside the same mailbox. It closes one leak channel; it does not replace MFA on mail accounts.

There is also an organizational cost. Someone has to review the report and the exception list once a quarter, or after a year you will have more exceptions than rules. That is about one hour per quarter.

Two cases from our projects

At one of our clients, an 18-person building materials wholesaler running Microsoft 365 Business Standard and Subiekt nexo (a popular Polish sales and inventory system), the audit took 3 hours including conversations. We found four external forwards. Two were deliberate: a salesperson forwarded mail to a private Gmail, and a former employee's mailbox had been going to the owner's private address for two years. One led to the previous IT vendor. The fourth was a rule in the bookkeeper's mailbox, created 9 days earlier, that moved emails containing "faktura" (invoice) and "przelew" (transfer) to the RSS folder.

We blocked external forwarding with no exceptions, reset the bookkeeper's password and turned on MFA for her. No customer had paid into the substituted account yet. Cost to the company: about 3 hours of our work and one conversation with the salesperson.

In another project, at a 35-person furniture plant running Comarch Optima (a widely used Polish ERP), the previous IT vendor switched the setting to "Off" on a Friday afternoon without checking the report. The complaints@ mailbox forwarded mail to an external ticketing system, and invoices@ to the accounting firm. For two working days about 40 complaints bounced back to customers, one retail chain escalated the issue to management, and the month-end close slipped by two days. The fix, two separate policies for those mailboxes, took 3 hours.

The lesson from the second case: read the forwarding report for a week or two and build the list first, then block. And never change this on a Friday.

What to do this week

External mail forwarding is rarely an attack, but an attack almost always leaves a rule behind. Check the rules in an hour, map the exceptions, and only then block forwarding for the whole company.

← Back to blog