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

Keep your BADMAIL good and clean

BadMailAdmin.Exe automatically deletes and archives BADMAIL files.

By default Exchange accepts messages even when the user name is not valid so you can analyze them at a later time if you want.

Mail with these invalid user names is routed into BADMAIL, which is usually located at Program Files\Exchsrvr\Mailroot\vsi1\BadMail.

Contrary to what you might think about the way this folder works, Exchange or the system does not automatically purge BADMAIL's contents. You have to clean out BADMAIL manually.

Under exceptionally heavy traffic conditions, with a great many failed incoming messages, the BADMAIL folder can bloat up quite a bit. In fact, if the BADMAIL folder is filling up a great deal, this could be a symptom that your machine is being used as an open relay. You should double-check to make sure this is not the case, and use the messages in BADMAIL to determine who might be staging such an attack.

There are several ways to manually clean the BADMAIL folder. The first and most obvious is to create a batch file that runs once a week or at some other scheduled interval. This batch command doesn't need to be anything more than a command like: del/Qc: \Program Files\Exchsrvr\Mailroot\vsi 1\BadMail\*.*.

Note that the path listed here may be different from the actual path to the BADMAIL folder on your server. While the Exchange service does not need to be stopped to delete the files, any file that is currently in use at the time the script is run will not be deleted.

Another method is to use a program published by Microsoft, BadMailAdmin.Exe, which automatically deletes and archives BADMAIL files. The program can set a limit for the size of the directory and automatically keep it from running over that size. The program (which is for Exchange 2003 only at this time) can be downloaded here.

Serdar Yegulalp is the editor of the Windows 2000 Power Users Newsletter.

Do you have a useful Exchange tip to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on Exchange Server setup and troubleshooting