Link to home
Start Free TrialLog in
Avatar of dog_star
dog_star

asked on

How to clear IIS6 SMTP Mail Queue ?

hi,
i'm running a windows 2003 server to host a number of websites... after some recent technical difficulties i had to rebuild the server...

unfortunatly it looks like i didn't correctly protect the SMTP mail server (which is only used for sending out CDO emails from hosted sites, the main mailserver i use for clients is smartermail)...

our IP address was  blocked by yahoo and other big isps for sending spam a few days ago...

i checked the 'badmail' folder in the inetpub and found there were upwards of 250,000 bounced mails there... some spammers were obviously having a field day with my smtp server...

i've now changed the settings so that realys are only accepted from 127.0.0.1 and anonymous access is now disallowed.

my problem is that when i start up the SMTP server again spam is continuing to be sent out because the Queue folder is apparently full of junk waiting to go out...

i've tried entering this folder but the computer hangs, presumably because there are so many there...

i've tried deleting and renaming the folder but even with the smtp server turned off i get an 'Access Denied' error...

what can i do to flush or empty the queue folder ?
ASKER CERTIFIED SOLUTION
Avatar of RemcovC
RemcovC
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Go into Windows Services MMC and stop the "Simple Mail Transfer Protocol (SMTP)" then open the folder and delete all the messages in the queue folder.

1) Start > All Programs > Administrative Tools > Services, then stop "Simple Mail Transfer Protocol (SMTP)".

2) Open c:\inetpub\mailroot\queue using Windows Explorer, and delete all the files.

3) Restart  "Simple Mail Transfer Protocol (SMTP)".
Sorry should have read the whole question.

dog_star is right you can use the command prompt to delete the emails in the queue folder.

Alternative Queue Clean Up Method

If you have a very large number of messages, then there is a command line tool that you can get from Microsoft.

ftp://ftp.microsoft.com/pss/Tools/

Then go in to the folders: Exchange Support Tools / Aqadmcli
(Due to the use of spaces in the folder names, a direct link isn't possible)

After downloading the utility use the following command to clear all the queues.

aqadmcli delmsg flags=all
Stop SMTP.
Hard Delete the Badmail and the Queue Folders (hold down shift and click delete - that bypasses the recycle bin).
Once complete, restart SMTP. The folders will be recreated.

-M
Avatar of dog_star
dog_star

ASKER

remcov... spot on, tha\t worked great.... it took about 3 hours but now there is a totally empty folder.... and it didn't hang or slow-down windows while it was doing it (which is what happened when i tried in explorer)....

thanks to everyone else for their contributions :)