Exchange Server's BADMAIL folder is the "dumping ground" for email messages that cannot be delivered successfully, or for the non-delivery reports (NDRs) for those messages. In Unix email terms, this is roughly the same as the dead.letter file.
BADMAIL messages are mostly used for diagnosing on-going problems with email. If the Exchange server encounters a great many email delivery failures, the BADMAIL folder fills up quickly and needs to be manually purged. Since there's one BADMAIL folder per virtual server, these files can get quite prolific.
Exchange 2003 Service Pack 1 changes this behavior. After a good deal of negative user feedback about the BADMAIL folder gobbling excessive amounts of server space (often without the administrator realizing it, or even bothering to make use of the files in it), the default behavior for BADMAIL was changed.
Once Exchange 2003 SP1 is applied, NDRs and the like are not written to the BADMAIL folder; they simply disappear. For most administrators who never have to bother with BADMAIL, this is a blessing; they can clean the folder out and forget about it.
However, what if you need to turn BADMAIL reporting back on? Doing that requires a registry edit, but by doing so you can also set BADMAIL behavior a lot more flexibly than before. To change this behavior, edit a DWORD setting in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\SMTPSVC\Queuing.
The value to add or change, MaxBadMailFolderSize, is the maximum size in kilobytes allotted to each BADMAIL folder. Once this amount of space is used up in a BADMAIL folder, no more messages will be written to it.
Set this value to -1 (decimal) to allow for an unlimited folder size (i.e., the pre-SP1 behavior). Set it to 0 (the default in SP1) to not write to the folder at all. Note that newer messages do not delete older ones; once the folder size is reached, no more new messages are written.
Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter.
Do you have a useful Exchange Server tip to share? Submit it to our monthly tip contest and you could win a prize.