locked
Get failure reasons from emails RRS feed

  • Question

  • Hi there,

    We have a system that sends emails to a lot of clients on a lot of different email systems.

    We often get delivery failures and our system reads the delivery failure reports (from our mailboxes) and produces a report (containing the delivery failure reason).

    Then, we can decide whether to re send the email or to do something else. e.g. if the email is not delivered because the server was unreachable or the user was over quota, we can re send the email the following day. If the email is not delivered because the user does not exist, we call up the client and check whether the user is still there and whether his email address has changed...

    We already do this on our current system, but we will move to Office365 soon and we need to change our program to do the same thing with our Office365 email accounts.

    We have already figured out that such emails have "Undeliverable:" in the subject line.

    We are now trying to get the reason for the email not being delivered.

    We found this: http://www.serversmtp.com/en/smtp-error and are thinking about looking for the line containing one of the codes.

    Has anyone on this forum faced the same problem and how did you solve it?


    • Edited by Nad Surf Friday, November 4, 2016 8:46 AM
    Friday, November 4, 2016 8:45 AM

Answers

  • Hi,

    To know if this message is an NDR, we can also check the content of them, all NDR messages will contain NDR code in message content. And if you are using exchange server to send these message, then it's easy to get these NDR messages with the following steps:

    1. Create a new mailbox and configure it to catch all internal/external NDR message.

    Set-TransportConfig -ExternalPostmasterAddress postmaster@domain.com

    Set-OrganizationConfig -MicrosoftExchangeRecipientReplyRecipient Postmaster@domain.com

    2. Set What all the NDR’s you want to catch from the server

    Set-TransportConfig -GenerateCopyOfDSNFor 5.4.8,5.4.6,5.4.4,5.2.4,5.2.0,5.1.4,5.1.1

    Set-TransportConfig -GenerateCopyOfDSNFor @{Add="5.7.5"; Remove="5.7.1"}

    3. Login this new mailbox, you will see all NDR messages.


    Best Regards,

    Lynn-Li
    TechNet Community Support


    Please remember to mark the replies as answers.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Nad Surf Monday, November 21, 2016 8:00 PM
    Wednesday, November 16, 2016 1:54 AM

All replies

  • Hi,

    May I know the specific NDR messages? That will help us to troubleshoot.

    And you can do message tracking to see what happened to these messages.

    https://technet.microsoft.com/en-us/library/bb124375%28v=exchg.160%29.aspx?f=255&MSPPError=-2147217396

    Recipient-status field would tell you something.


    Regards,

    Lynn-Li

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Proposed as answer by Lynn-Li Tuesday, November 15, 2016 12:28 PM
    Monday, November 7, 2016 2:26 AM
  • Hi,

    Have you tried my suggestions above? I am still waiting for your response.


    Best Regards,

    Lynn-Li
    TechNet Community Support


    Please remember to mark the replies as answers.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, November 15, 2016 12:31 PM
  • Dear Lynn,

    Sorry for the late reply.

    In fact we do not know which NDR messages we will get yet.

    We need to be able to identify the NDRs

    Our script will loop on each email received and check if it is an NDR.

    From the list of NDRs it will create a summary.

    Our user will then see what to do (resend, delete the address, update the address).

    What I need to know is if there is a property/flag that says that an email is an NDR.

    Tuesday, November 15, 2016 1:06 PM
  • Hi,

    To know if this message is an NDR, we can also check the content of them, all NDR messages will contain NDR code in message content. And if you are using exchange server to send these message, then it's easy to get these NDR messages with the following steps:

    1. Create a new mailbox and configure it to catch all internal/external NDR message.

    Set-TransportConfig -ExternalPostmasterAddress postmaster@domain.com

    Set-OrganizationConfig -MicrosoftExchangeRecipientReplyRecipient Postmaster@domain.com

    2. Set What all the NDR’s you want to catch from the server

    Set-TransportConfig -GenerateCopyOfDSNFor 5.4.8,5.4.6,5.4.4,5.2.4,5.2.0,5.1.4,5.1.1

    Set-TransportConfig -GenerateCopyOfDSNFor @{Add="5.7.5"; Remove="5.7.1"}

    3. Login this new mailbox, you will see all NDR messages.


    Best Regards,

    Lynn-Li
    TechNet Community Support


    Please remember to mark the replies as answers.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Marked as answer by Nad Surf Monday, November 21, 2016 8:00 PM
    Wednesday, November 16, 2016 1:54 AM
  • Thank you Lynn.

    If needed, I will try your solution.

    For the moment, I found this:

    https://blogs.technet.microsoft.com/eopfieldnotes/2014/12/16/message-trace-the-powershell-way/

    There is a section where the author describes how to get all emails that "failed".

    • Proposed as answer by Lynn-Li Tuesday, November 22, 2016 1:19 AM
    Monday, November 21, 2016 8:00 PM