I was inherited this server so I'm not yet fully familiar with its setup.
However, I noticed that C:\inetpub\mailroot\Badmail\
directory contains ~400,000 files. For now I do not want to delete the whole thing, only perhaps files older than 1/1/2012
.
I tried to use BadMailAdmin script, however when I run it on that dir, it errors out with:
ERROR: C:\inetpub\mailroot\Badmail\: bytes total.
Err.Number: 6
Err.Description: Overflow
Err.Source: Microsoft VBScript runtime error
Possibly because of so many files in there. I tried to use just regular Windows Explorer. It takes ~5min to get dir listing, but when I select a bunch of files to delete it starting chewing 100% CPU of one core and does not comeback in 2 hours that I waited.
If there any way to (quickly) delete some of these files?
Note, this is NOT Exchange server, just regular IIS/smtp.
I tried to use
del /q *.*
and rd but no results. Several days the commands have been only preparing for deleting... What was the progress no one did know...I decided to write a script so the bad files would be deleted one by one. At least with it you can see that the files are deleted. At start they are deleted slowly, but then the process increases speed of deletion.
The script is very simple:
In case you use batch file please add one more
%
to%i (%%i)
Good luck!
Those files are undeliverable emails so just delete all of them. I don't see any point or value in keeping any of the files in the folder.
Try deleting them from the command line.
BadMailAdmin script version 1.0 (Published 2004-09-21) on a Windows Server 2008 R2 with IIS/SMTP.
In my case, the BadMail directory was too large for use with the default variable data type used in the script ('Long'). I had to change it to 'Single' (see VB Error Reference for a more detailed explanation of this issue and VB Data Types for the variable data types).
Try the following:
cFolderMBSize = C
Lng
(oFolder.Size)
" to "cFolderMBSize = C
Sng
(oFolder.Size)
"I used this to get the size down enough so that the original script (with the long variable data type) could be used for ongoing maintenance.