Popular White Paper On This Topic

Based on your folder names (Badmail, Pickup), is it safe to assume you are talking about Exchange 200x? If so, you'd get more response by posting into an Exchange group, however...

The Badmail folder is the destination for mail that cannot be delivered during the 2-day SMTP default. Chances are most of these will be NDRs to spam you have received from non-existent domains. Others that may be legitimate messages will be from internal users who made a typo in the recipient address, or the receiving server is offline for an extended period. In either of those cases, your internal user gets an NDR stating the server could not deliver the message, so they can follow-up by phone or try sending again. You should be able to see most of the messages that will end up in Badmail by looking at the SMTP Queues for garbage domains (depending on how much business you do in Italy or China...).

By copying the files back into the Pickup folder, all you are doing is resubmitting mail that couldn't be delivered the first time, and that isn't likely to change the second time around. If you are not actually reviewing the files (they are just text files) to see if it was a mistyped address, why bother doing anything other than deleting them all?

Exchange 2003 SP1 actually disables the Badmail functionality because most admins never check it anyway. Prior to that you could download a tool called BadMailAdmin that would help manage the folder. (I used to work at Microsoft doing Exchange support and had one customer with 800,000 files in the folder & it took 6 hours to delete).

In regards to your scipting, the Badmail folder for Exchange does not exist for each database - there is only one for each SMTP Virtual Server (only 1 of them by default). The default location will usually be c:\Program Files\Exchsrvr\Mailroot\Vsi 1\BadMail.

The '%' tag in a batch file indicates variable position in the call, so "%6" means the 6th input to the command. The way I read your code you would have to enter "badmail 0 0 0 0 0 6" in order to run it against the 6th badmail folder, when I think you probably meant to use "badmail 6".

Copyright 1998-2015 Ziff Davis, LLC (Toolbox.com). All rights reserved. All product names are trademarks of their respective companies. Toolbox.com is not
affiliated with or endorsed by any company listed at this site.