Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bad mail folder 18

Status
Not open for further replies.

jbead

IS-IT--Management
Jun 28, 2002
74
0
0
US
where do I find this folder on my exchange folder? how do I manually clean it because I was told that I should reboot when done. Thanks

JBead
 
If you have the resource kit installed on the server, you can also trigger an event log entry to show that this started/completed/ran.

Something like
logevent -m \\servername -s I -r "MSExchange Maintenance" -e 2873 "Badmail cleanup complete
 
I don't understand why you are using the del *.* command why not just use:

rmdir badmailold /s /q

This will delete all the files even quicker.
 
Lander215 is right. You do not need to stop the smtp service and rename directories, etc. Here is my batch file for the exact same goal:

del /Q /F "D:\ExchSrvr\Mailroot\vsi 1\badmail\*"

It works like a champ and my smtp server is down for 0 seconds. Can anyone beat that? The more unnecessary steps you take, the more chances you have for something to go wrong. It is not uncommon for the smtp service to hang when running the net stop command. So let's say you run your script after hours and it hangs. Now you get a phone call in the morning that email isn't working. Users are down, you lose sleep, etc. Why take that chance? It isn't necessary. Good Luck.
 
Well sumnone....You have come into the picture a little late. But if you say this command works and you do not need to stop the SMTP Service than I would be in agreement with you. Are you stating you have a script that just has the following statement:
del /Q /F "D:\ExchSrvr\Mailroot\vsi 1\badmail\*" and this works? Never heard of this. I was always under the impression (from talking with Microsoft) that you need to stop the SMTP service, rename the badmail (well you get the picture from what I noted above). And I have had some times where the SMTP service did hose and I had to reboot the server. I need some convincing though. Can you explain the command you list? What does it do?
 
Sumnone,

I'm convinced. Just tested it. This is great. This is so much better not having to stop the SMTP service. You know Microsoft don't tell you these things. I know I posted many notes here thinking that my script would be the best method. Turns out there have been quite a few occasions where the SMTP service hosed on me and we would have to reboot during the day. This definitely will save me from that headache so many thanks.

 
Hi zoeythecat,

I'm glad I could help. Believe me, I've learned the hard way with the net stop command on other issues. Since exchange doesn't lock these files, they are easily deleted. The line in the batch file is nothing more than a delete command from DOS. If you do del /? at a command prompt you can see all the options for the delete command. The two switches I used are /Q so that it doesn't prompt you (silent mode), and /F so that it will force a delete on Read-Only files. The /F isn't really necessary, but it doesn't hurt either. The rest of the line is the path to my Exchange badmail folder. Throw it in the Task Scheduler and forget about it. I have been searching for a more legitimate solution for a while now, but have come to accept my single line batch file as the simplest solution. They have a real solution for my "badmail" issue in Exchange Server 2003 called "recipient filtering". Most of my badmail comes from NDRs to invalid addresses stemming from recipients that no longer exist or never existed. This new option will definitely cut down my badmail by about 99%. Check it out. If it solves your issue, you might have better luck convincing your boss to upgrade than I am. ;)

Best of luck.
 
Thanks a lot for all your answers. We are running an Exchange Server System for only a short time now and i never paid any attention to that subject. I implimented the script now, works great!

Thanks again to all of you!
 
Been reading over this and didn't see anyone else mention it so I will.

Microsoft very recently (5/24/2004) released a great script for taking care of the BadMail folder. It gives you lots of control on what and how many messages are deleted.

Check it out, it's a lot better than a batch file. At almost 1,200 lines of code I would hope so :)

 
Saexpress,

This script is for Exchange 2003. I do not believe this will work for Exchange 2000 but I could be wrong. This script is a util that is on the Exchange 2003CD
 
I have just implemented the script and it works a treat.

Our customer has a Pop3 account which recipients are then managed by exchange.

Now I can access the Badmail folder I have found that the BadMail folder was filling up do to NDR reports been sent to Spam senders and then replies from that domain saying that that account does not exist.

Turned off NDR reports and the BadMail folder contents reduced from 500 objects per 30 mins to 5.

We now have spam filtering enabled at the clients ISP which should drastically reduce the scale of junk mail.

Just thought i would share that if the BadMail is suddenly filling up out of control theres got to be a reason.

Hope this helps someone else

Steve Itaddiction


 
zoeythecat - that MS script works for exchange2000 and 2003.


pbxman
Systems Administrator

Please let Tek-Tips members know their posts were helpful.
 
That M$ script also manipulates IIS badmail too. So be careful. My IIS badmail content is a LOT more valuable to me than my Exchange badmail content. Remember keep it simple, bigger isn't always better.
 
Hello guys!

For your info, why MS recommend to rename the folder:
"Trying to delete so many files could be a nightmare, and takes too long. To delete files from a flooded mail queue, I recommend to renaming the mailroot directory and creating a new one so the Exchange Virtual Server will be able to load. Then, delete the files by using the command prompt. It still takes an awfully long time but less than with Explorer."
(from
Attila Szabo
MCSE MCSA ASE SCSE
 
Attila,

If you read this post more closely you will see all you have to do is run a one line command script where all you do is delete the contents of the badmail folder WITHOUT HAVING TO RENAME ANY FOLDER OR STOPPING ANY SERVICES.
 
I apologize if I am in the wrong section or not posting correctly, but I am not actually an IT person, just trying to maintain the exchange information as our IT person left us stranded. I noticed while running a virus scan that most viruses are being quarantined into the badmail folder. I was wondering if anyone could assist in a step-by-step process for implementing this script (del /Q /F "D:\ExchSrvr\Mailroot\vsi 1\badmail\*" )? I would be very grateful.

Rabbi1856
 
I would suggest manual deletion if you are not familar with scripts for if something goes wrong with the script it could leave you cripple.

Also, look into a third party such as message labs (messagelabs.com) who for a small cost scans all your mail for virues before sending it on to your mail server and offers spam protection as well.

good luck

JBead
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top