Problem solve Get help with specific problems with your technologies, process and projects.

Dealing with undeliverable messages in Exchange Server

Discover how Exchange Server handles undeliverable messages and how to modify non-delivery notification options.

Please let others know how useful this tip is via the rating scale at the end of it. Do you have a useful Exchange...

or Outlook tip, timesaver or workaround to share? Submit it to our tip contest and you could win a prize.


In an Exchange environment, messages may go undelivered for any number of reasons. For example, a communications link may be down, or a DNS server may have trouble resolving the recipient's domain. In any case, undeliverable messages can disrupt the flow of communications among your employees, suppliers and clients. Fortunately, you do have some control over how Exchange handles undeliverable messages.

Accessing non-delivery options

In Exchange Server 2003, non delivery options are controlled at the SMTP level virtual server level. To access the non-delivery options:

  1. Open Exchange System Manager and navigate through the console tree to Administrative Groups -> your administrative group -> Servers -> your server -> Protocols -> SMTP -> Default SMTP Virtual Server.

  2. Right click on the Default SMTP Virtual Server and select Properties.

  3. Click on the Delivery tab to view the message's non-delivery options.

By default, if Exchange Server is unable to deliver a message, it will try again in 10 minutes. If Exchange is still unable to deliver a message, it will wait 10 more minutes before making another attempt. If the message is still undeliverable, Exchange perform a third retry.

At that point, if the message hasn't been delivered, Exchange will try to deliver it in 15 minute intervals for the next two days. If the two days go by, and Exchange still hasn't been able to deliver the message, a non-delivery report will be issued.

Microsoft has disabled the BADMAIL directory in Exchange Server 2003 SP1. But previous versions of Exchange would place a copy of the message into the BADMAIL directory as well. The message would sit in the BADMAIL directory indefinitely until so many non-deliverable messages were placed into the BADMAIL directory that the server ran out of disk space.

Modifying non-delivery options

Now that you know how Exchange deals with non deliverable messages, let's look at how you can modify this behavior. As you can see in Figure A, the Default SMTP Virtual Server Properties' Delivery tab allows you to set the timing of the first, second, third and subsequent retries. You can also control the expiration timeout of the message.

Figure A
Figure A

One other field worth mentioning on this tab is the Delay Notification setting. By default, Exchange is configured so that, if the message hasn't been delivered within 12 hours, the sender will receive a message indicating that the message has not yet been delivered, but that there is no need yet to resend. You can change this notification period from 12 hours to anything that fits your needs.

Setting BADMAIL options

I mentioned earlier that, in previous versions of Exchange, the BADMAIL directory acted as a sort of black hole for undeliverable messages. I think Microsoft was wise to disable the BADMAIL directory, because most administrators never use it. But if you do have a need for it, you can use the registry to re-enable it, and to keep it from growing to an unreasonable size.

Before I show you how to set BADMAIL options, remember that editing the registry is dangerous. If you make a mistake you can destroy Windows and/or your applications. So make a full system backup before continuing.

With that said, you can access the BADMAIL settings at HKEY_LOCAL_MACHINE\System\Current Control Set \Services\SMTPSVC\Queuing.

Once there, there are two different registry keys that you need to pay attention to (you will have to create these keys if they don't already exist):

  1. The first key is a DWORD value named MaxBadMailFolderSize.

    This key indicates the KB size that the BADMAIL folder can grow to before older items are discarded. By default, this value is set to 0 in Exchange Server 2003 SP1, which disables the BADMAIL folder. If you would like to restore the BADMAIL folder to its pre-SP1 behavior, and allow unlimited folder growth, change this value to -1. Otherwise, just specify the folder size. For example, a value of 3072 would allow the BADMAIL folder to grow to 3 MB.

  2. The other key that you need to pay attention to is a DWORD value named BadMailSyncPeriod.

    This value tells Exchange how often it needs to check for changes in BADMAIL folder size. If you manually delete items from the BADMAIL folder, Exchange will be unaware that those items are gone until it runs a BADMAIL sync. This value tells Exchange how often that sync should happen.

    The synchronization period is set to 0, which disables it. But you can set this value to -1, if you want, which allows it to behave the way that it did prior to SP1. You can also specify a period of time, in minutes, for a synchronization to occur. If you choose to use the BADMAIL folder, I recommend performing a BADMAIL sync every 10 to 15 minutes.

About the author: Brien M. Posey, MCSE, is a Microsoft Most Valuable Professional for his work with Windows 2000 Server and IIS. Brien has served as the CIO for a nationwide chain of hospitals and was once in charge of IT security for Fort Knox. As a freelance technical writer he has written for Microsoft, TechTarget, CNET, ZDNet, MSD2D, Relevant Technologies and other technology companies. You can visit Brien's personal Web site at http://www.brienposey.com.


Do you have comments on this tip? Let us know.
Related information from SearchExchange.com:

  • Ask the Expert: How to designate NDR recipients
  • Tip: Service Pack 1 makes BADMAIL disappear
  • Reference Center: Non-delivery reports



  • Dig Deeper on Legacy Exchange Server versions

    Start the conversation

    Send me notifications when other members comment.

    Please create a username to comment.

    -ADS BY GOOGLE

    SearchServerVirtualization

    SearchCloudComputing

    SearchSQLServer

    SearchEnterpriseDesktop

    SearchVirtualDesktop

    Close