Send & Receive Issues

Customize an Exchange Online NDR From a Mail Flow Rule

Algirdas JasaitisAlgirdas Jasaitis Nov 20, 2026 869 views

Question details

An administrator wants to customize the nondelivery report generated when an Exchange Online mail flow rule rejects a message.

Customize an Exchange Online NDR From a Mail Flow Rule
Product
Exchange Online
Device & OS
not provided
Scenario
A mail flow rule rejects messages and should explain the rejection to senders.
Observed behavior
The custom rejection text appears within the standard formatted nondelivery report, but the rest of the template remains unchanged.
Before you start

Sign in to the Exchange admin center with an account permitted to manage mail flow rules. Identify the rule conditions and the rejection text you want senders to see.

Solution 1Recommended

Add custom rejection text to the mail flow rule

Use this approach to explain why a message was rejected while retaining the standard Exchange Online NDR format.

Exchange Online inserts the supplied text into its standard nondelivery report. The complete built-in NDR template cannot currently be replaced or fully edited through a mail flow rule.

1
Open mail flow rules

In the Exchange admin center, go to Mail flow > Rules. Select an existing rule to edit, or choose Add a rule > Create a new rule.

2
Set the rule conditions

Under Apply this rule if, select the conditions that identify the messages you want to reject.

3
Enter the rejection explanation

Under Do the following, select Block the message > Reject the message and include an explanation. Enter the text you want to appear in the NDR.

4
Save and test the rule

Save the rule, enable it if necessary, and send a test message that meets its conditions. Check the resulting NDR for your explanation.

Add custom rejection text to the mail flow rule
Full template customization: If you need complete control over the notification layout, consider an alternative mail flow or application design. You can also submit a feature request through the Microsoft 365 feedback channel.
Free Microsoft Office alternative

Prepare Mail Policy Documents With WPS Office

WPS Office is a free, lightweight alternative for creating and sharing mail policy documents in a familiar interface. Its Office format support makes it easy to move existing documents, although it cannot change Exchange Online NDR templates.

Draft sender-facing mail policies and rejection guidanceOpen and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXUse a familiar interface for a smooth transition from Microsoft OfficeWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Can I replace the entire Exchange Online NDR template?

No. A mail flow rule can add a custom rejection explanation, but Exchange Online retains the standard NDR structure.

Where do I enter the custom rejection text?

In the Exchange admin center, go to Mail flow > Rules, edit the rule, and select Block the message > Reject the message and include an explanation under Do the following.

Why does my text appear inside a standard formatted report?

The mail flow rule supplies the rejection explanation, not a replacement template. Exchange Online adds that explanation to its built-in nondelivery report.

What can I do if I need a fully customized notification?

Consider an alternative mail flow or application design that provides the notification format you need. You can also submit a feature request through the Microsoft 365 feedback channel.