I have a listener that processes emails in the inetpub/mailroot/Queue
directory. Once the listener is done processing an email it proceeds to move the email to another directory. However, moving the email is not possible due to a file lock by the process inetinfo.exe
. I have noticed that this file lock is released after a period time that ranges from several hours to several days. You can see that the Queue
directory can get pretty full over time.
The only way I have been able to work around this is by manually stopping and starting my SMTP virtual server in IIS.
Is it possible to release this file lock programmatically? If not, is it possible to expedite releasing this file lock?
UPDATE
The listener monitors the Queue
folder for incoming emails and then processes them. Data from the emails is then inserted into an internal program of ours. After the listener is done with the email it moves the email to a success or fail directory elsewhere.
SOLVED
After coming back to this problem almost a year later I was finally able to solve it! The solution was to configure the SMTP Virtual Server's local (default) domain and set it to the appropriate domain of the emails I wanted to process. This caused emails to go into the Drop
folder where they could be freely manipulated without having to worry about process locks.