Customize an Exchange Online NDR From a Mail Flow Rule
Question details
An administrator wants to customize the nondelivery report generated when an Exchange Online mail flow rule rejects a message.

- 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.
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.
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.
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.
Under Apply this rule if, select the conditions that identify the messages you want to reject.
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.
Save the rule, enable it if necessary, and send a test message that meets its conditions. Check the resulting NDR for your explanation.

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.

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.




