Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recieve all the undeliverable reports for mailings sent from my company. Moving and cataloguing them can take a while, and it would be handy if I could create a rule that did that for me.

The most robust way of doing this would seem to be to run a rule based on the Undeliverable message class. However, I can't see message class as an option anywhere in the advanced rules wizard, and Googling it is no help.

EDIT: I already have a rule that searches for "Undeliverable" in the subject header of emails received and moves them, but this only affects traditional emails (i.e. those with a message class of "Message") and ignores actual undeliverable reports.

Am I missing something obvious, or can this not be done?

share|improve this question
up vote 2 down vote accepted

You can't do that with Outlook rules. But you can with Outlook macros. First, enable macros in Outlook Options' Trust Center. Then in Outlook press ALT+F11 to open VBA and paste the following macro to ThisOutlookSession. After that, save changes and restart Outlook. The macro will move all NDRs to "NDR" subfolder of your Inbox. It will also create this subfolder if necessary. Fell free to replace ("NDR") with your own folder name if needed.

Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()
    Set Items = Session.GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)
    On Error Resume Next

    If UCase(Item.MessageClass) = "REPORT.IPM.NOTE.NDR" Then
        Set Folders = Session.GetDefaultFolder(olFolderInbox).Folders
        Set Folder = Folders.Item("NDR")
        If Folder Is Nothing Then
            Folder = Folders.Add("NDR")
        End If
        Item.Move Folder
    End If
End Sub
share|improve this answer
Works like a dream, if you dream about code. Thanks, @thims. – BFWebAdmin Oct 31 '13 at 9:11

Depending your need, the following rule should work.

Change and myUndeliverable to suit your environment.

Apply this rule after the message arrives


and with Undeliverable in the subject

move it to the myUndeliverable folder

and stop processing more rules

Non-delivery reports (NDRs) could only be moved to folder, but not be forwarded to the others.

share|improve this answer
Hi - this is what I've got set up currently, but this only catches emails with the message class "Message" (i.e. standard e-mails) and "Undeliverable" in the title, and ignores actual undeliverable reports, hence this question - I should have said this above, so will edit my original question as well. – BFWebAdmin Oct 30 '13 at 10:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.