You can clean this by creating a bat file. Here is a bat file that I use:
____________________________________________________ net stop smtpsvc
cd "c:\exchsrvr\mailroot\vsi 1"
ren badmail badmailold
cd "c:\exchsrvr\mailroot\vsi 1\badmailold"
del *.*
cd "c:\exchsrvr\mailroot\vsi 1"
rmdir badmailold
md BadMail
net start smtpsvc
______________________________________________________
So open up notepad, copy this into the notepad, save the file with a .bat extension. Save this to the root of C. Then do the following:
(1) Go to a dos prompt
(2) Run the .bat file (whatever you named the file) by typing xxxxx.bat (xxxxx=file name.bat).
* note that you will be prompted to delete the directory badmailold. Just reply "y".
What this bat file will do is this:
(1) stops the smtp service.
(2) Changes directory to the vsi 1 directory
(3) Renames badmail folder to badmailold
(4) Deletes all files in the badmail old folder
(5) Creates new BadMail folder
(6) Starts the SMTP Service.
I run this command once a week. The badmail folder will get huge if you don't.
Why do you do all of that zoeycat? I just set my batch file to delete everything in the badmail folder every morning and it's been working great for months now. I don't do all that renaming and recreating.
I'm Certifiable, not certified.
It just means my answers are from experience, not a book.
What works for you Lander is great. I'm not doing all that work. I simply run the bat file. The bat file does everything for me and it takes all of 30 seconds to run. How much work is that? And also this is the way Microsoft recommends so i'm just following their instructions.
Take it easy, deep breath...ok, let's try this again.
I was curious as to why you had your batch file creating directories, renaming directories, and stopping/starting the SMTP service, that's all. That's a alot of stuff going on versus simply deleting everything in the \badmail folder from a bat file. (and btw, I didn't say anything about doing all that "work", simply doing all that)
You say MS recommends this? Ok, that's cool, can you tell me where they recommend this? I'm curious because when you stop/start the SMTP service, you temporarily inhibit the ability of your exchange server to receive email, that's all. I try to keep my starting/stopping to a complete minimum. If MS recommends it, they usually have a reason, and I'd like to research this and perhaps mod my routine.
I'm Certifiable, not certified.
It just means my answers are from experience, not a book.
thanks so much for the bat file. I was told that you should stop and start the services as well and that it should be done at night. I will implement this right away. thanks,
I'm taking a deep breath now. Phew...Thanks for the advice. Feel better now.
I've troubleshooted this issue with Microsoft. That is how I know because I was experiencing the same problems with the badmail queue and opened a case with Microsoft regarding this. I won't go into every detail of the notes but this is the recommended way of clearing the badmail queue. Here are some notes from the Microsot Tech regarding the bat file I should create
________________________________________________________
There's no way to automate this process that I know of other than to write a batch file to go through these same steps. The batch file might look like this, assuming that your Exchange files are on the E drive:
Net stop smtpsvc
cd "e:\program files\exchsrvr\mailroot\vsi 1"
Ren badmail badmailold
Move badmailold \\server\share\badmailanalysis
Md badmail
Net start smtpsvc
_________________________________________________________
Hope I answered your question? The script I listed works for me in my environment. There are no articles referencing this script. But there is an article in MCP Magazine (Boswell's Q+A) that gives this same exact script. And as I noted the SMTP Service is stopped for about 30 seconds. I could see if this process took several minutes then it would be a concern.
Cheers...Thanks for the Star.....I did place that /Q to the end of the rmdir line and I still get prompted with the, "Do you really want to purge". I don't mind replying "Y" but any idea why the /Q did not work for me? I have a simple .bat file.
Well, I can't leave a good script alone. In order to shave a few seconds off the actual time that SMTP is down, I changed the order of the script a little.
setlocal ENABLEDELAYEDEXPANSION
cd "C:\Program Files\Exchsrvr\Mailroot\vsi 1\"
echo !time!
net stop smtpsvc
ren badmail badmailold
md BadMail
net start smtpsvc
echo !time!
del badmailold\*.* /Q
rmdir badmailold
echo !time!
This makes it where SMTP is only down for 6 seconds on our server, then the delete of badmailold occurs. This shaved about 30 seconds off the time that the service was unavailiable.
Guys and Girls,
I know I am a litlle late but let me tell you that you are the best.
Just wanted to express my thanks to all of you, for taking the time to help others and myself included.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.