๐ง Recipe ยท Exchange & Email
Forward All Emails from a Mailbox to a Distribution Group
Route all incoming messages from a user or shared mailbox to a distribution group in Exchange Online
Complexity
Intermediate
Impact
mail-flow + exchange-online + mailbox-configuration + distribution-groups + forwarding
Context
Why This Matters
There are many scenarios where you need to redirect all mail arriving at a mailbox to a distribution group: a departing employee's messages going to their team, a role-based inbox (like info@ or support@) feeding a shared notification list, or an alias consolidating messages into a team workflow.
Exchange Online offers several mechanisms for this โ mailbox-level forwarding (ForwardingAddress / ForwardingSmtpAddress), inbox rules, and transport rules. Each has different behaviour around keeping copies, handling aliases, and respecting external-forwarding policies. This recipe covers the most common path: configure mailbox-level forwarding via Exchange Online so that mail sent to the mailbox (including all its SMTP aliases) is automatically delivered to a distribution group.
Run this when you need a durable, admin-controlled forwarding setup that survives the user signing out, their Outlook rules being deleted, or their mailbox being converted between shared and regular types.
Expected Outcomes
After completing this recipe you will have:
- Confirmed the source mailbox and its alias addresses
- Identified the target distribution group and verified it accepts internal mail
- Configured mailbox-level forwarding on the source mailbox to the distribution group
- Chosen whether to keep a copy of each message in the source mailbox
- Validated that mail sent to the primary address and each alias is successfully forwarded
Risks & Considerations
Important considerations
- Mail loops: Never set forwarding such that the target group contains the source mailbox โ this creates an infinite loop and is blocked by Exchange, but misconfigurations can still cause NDR storms.
- External forwarding policy: If the distribution group resolves to an external address, the tenant's anti-spam outbound policy (
AutoForwardEnabled) may block delivery silently. This recipe assumes an internal distribution group. - Graph API limitations: The Microsoft Graph
mailboxSettingsendpoint does not exposeForwardingAddressorForwardingSmtpAddress. For reliable, mailbox-level forwarding you must use Exchange Online PowerShell (Set-Mailbox) or the Exchange Admin Center. Attempting to PATCH forwarding via Graph will return 200 OK but not persist forwarding โ this is a well-known gotcha. - Inbox rules vs. mailbox forwarding: Inbox rules (created via Graph or Outlook) only fire when the mailbox is actively processing the Inbox folder. They can be deleted by the user and do not apply to messages delivered directly to aliases that bypass the Inbox. Mailbox-level forwarding is the stronger, admin-enforced option.
- Audit and compliance: Silently forwarding a user mailbox to a group may have legal or HR implications. Document the change and, where required, notify the mailbox owner.
- Distribution group membership changes: Anyone added to the target group will now receive all forwarded mail. Review group membership before enabling.
Required Permissions
| Permission | Why It's Needed |
|---|---|
| Exchange Administrator (or Recipient Administrator) | Required to run Set-Mailbox and modify forwarding properties on any mailbox in the tenant |
| Exchange.ManageAsApp (Graph) | Required when running Exchange Online PowerShell from an automation/service principal context |
| MailboxSettings.ReadWrite | Required only if using Graph inbox rules as a fallback approach (weaker than Set-Mailbox) |
| Mail.ReadWrite | Required to create Graph-based inbox rules on the source mailbox |
| Group.Read.All | Required to look up the target distribution group's primary SMTP address |
The fastest way to get this done: just ask Dex. Copy the prompt below and paste it into your Dex conversation.
For IT Admins
Paste into Dex Pro
For End Users
How an employee would ask Dex for help
Configure forwarding via the Exchange Admin Center
The Exchange Admin Center (EAC) is the most reliable GUI path because it writes to the same mailbox properties as Set-Mailbox.
Step 1 โ Open the Exchange Admin Center
- Sign in to
https://admin.exchange.microsoft.comas an Exchange Administrator - Navigate to
Step 2 โ Locate the source mailbox
- Search for the mailbox by display name or primary SMTP (e.g.
{source_mailbox}) - Click the mailbox to open its properties pane
- Confirm the aliases listed under Email addresses match what you expect (e.g.
{primary_address}and{alias_address}) โ all aliases automatically inherit the forwarding setting
Step 3 โ Configure mail flow forwarding
- Select the Mailbox tab in the properties pane
- Under Mail flow settings, click Manage email forwarding
- Toggle Forward all emails sent to this mailbox to On
- In Forwarding address, enter the distribution group's primary SMTP address (e.g.
{target_group}@{domain}) - Check Deliver message to both forwarding address and mailbox if you want to retain a copy in the source mailbox (recommended for audit)
- Click Save
Step 4 โ Validate
- From an external account, send a test message to the primary address (
{primary_address}) - Send a second test message to each alias (
{alias_address}) - Confirm that members of
{target_group}receive both messages - If you enabled Deliver to both, confirm the source mailbox also retains copies
Graph API approach (limitations apply)
Important: Microsoft Graph does not expose the canonical ForwardingAddress / ForwardingSmtpAddress mailbox properties. The only forwarding mechanism available via Graph is an Inbox rule, which is weaker than mailbox-level forwarding (it can be deleted by the user and only processes messages that land in the Inbox folder). For production-grade forwarding, use the PowerShell recipe below.
Step 1 โ Look up the source mailbox
GET https://graph.microsoft.com/v1.0/users/{source_mailbox}?$select=id,displayName,userPrincipalName,proxyAddressesResponse includes the mailbox id and all SMTP aliases in proxyAddresses (aliases prefixed smtp:, primary prefixed SMTP:).
Step 2 โ Look up the target distribution group
GET https://graph.microsoft.com/v1.0/groups?$filter=mail eq '{target_group}@{domain}'&$select=id,displayName,mail,mailEnabledConfirm mailEnabled is true โ a security-only group cannot receive forwarded mail.
Step 3 โ Create an inbox rule on the source mailbox
POST https://graph.microsoft.com/v1.0/users/{mailbox_id}/mailFolders/inbox/messageRules
Content-Type: application/json
{
"displayName": "Forward all to {target_group}",
"sequence": 1,
"isEnabled": true,
"conditions": {},
"actions": {
"forwardTo": [
{
"emailAddress": {
"address": "{target_group}@{domain}"
}
}
],
"stopProcessingRules": true
}
}An empty conditions object means the rule matches every incoming message. Response 201 Created returns the rule id.
Gotchas
- The signed-in context needs
Mail.ReadWriteand oftenMail.ReadWrite.Sharedfor shared mailboxes; admin consent alone is not always sufficient โ the admin may also need explicit Full Access permission on the target mailbox in Exchange. - Inbox rules do not apply to mail delivered to the Junk Email folder or to messages routed by transport rules before they hit the Inbox.
- For a durable, tenant-enforced setup, prefer the PowerShell path.
Configure forwarding via Exchange Online PowerShell (recommended)
This is the canonical, supported way to configure mailbox forwarding and what the Exchange Admin Center calls under the hood.
Step 1 โ Connect to Exchange Online
# Install module once, if needed
Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser
# Connect as an Exchange Administrator
Connect-ExchangeOnline -UserPrincipalName admin@{domain}Step 2 โ Verify the source mailbox and target group
Get-Mailbox -Identity "{source_mailbox}" | Select-Object DisplayName,PrimarySmtpAddress,EmailAddresses,RecipientTypeDetails
Get-DistributionGroup -Identity "{target_group}@{domain}" | Select-Object DisplayName,PrimarySmtpAddress,MemberJoinRestrictionStep 3 โ Apply forwarding
# Forward and keep a copy in the source mailbox
Set-Mailbox -Identity "{source_mailbox}" `
-ForwardingAddress "{target_group}@{domain}" `
-DeliverToMailboxAndForward $trueForwardingAddress expects a recipient that exists in the directory (like a distribution group) and is the preferred property. Use ForwardingSmtpAddress only for external/non-directory addresses.
Step 4 โ Confirm
Get-Mailbox -Identity "{source_mailbox}" | Select-Object PrimarySmtpAddress,ForwardingAddress,ForwardingSmtpAddress,DeliverToMailboxAndForwardStep 5 โ Test and monitor
- Send test messages to both the primary address and each alias
- Check message trace:
Get-MessageTrace -RecipientAddress {source_mailbox} -StartDate (Get-Date).AddHours(-1) -EndDate (Get-Date)
To remove forwarding later
Set-Mailbox -Identity "{source_mailbox}" -ForwardingAddress $null -ForwardingSmtpAddress $nullNext steps