Can anybody enlighten me on how to move the C:\Inetpub\mailroot\ directory to a different location i.e. D:\ on a Windows 2003 Server that does not have Exchange installed on it?

The only modifiable directory I can seem to find on the Default SMTP Virtual Server properties IIS is C:\Inetpub\mailroot\Badmail

We have GFI Mail Essentials also installed on this server and it appears when emails are trapped on the quarantine list they actually remain in the C:\Inetpub\mailroot\Queue\ directory opposed to the Quarantine folder that you can actually redirect within GFI and is already configured to point to a directory on the D:\ drive.

Exchange 2010 is installed on a different Windows Server 2008 R2 Server BTW.

Thanks in advance


Use Microsoft Robocopy to mirror the folders and files to the new drive. Be sure to include the NTFS permissions too.

For example, if D:\Inetpub\ doesn't already exist, the following command should work.

robocopy C:\Inetpub\ D:\Inetpub\ /MIR /SEC

Now that the content has been duplicated, change the paths from within the application. You shouldn't have any issue since the content is already at the destination and the file permissions are the same.

Lastly, check if there are any shares associated with the prior file locations. File shares can be reviewed by running the following PowerShell command.

gwmi win32_share | ft -auto

If file shares exist, those will need to be modified to point to the new location and use the same permissions. Easiest to do this manually on a case by case basis.

  • This doesn't actually answer the question, which is about how to move the mailroot directory in IIS; in this case, "change the paths from within the application" is definitely not as easy as it might seem. – Massimo Feb 3 '16 at 21:01
  • As mentioned, the change should be made with the application (IIS Manager and/or GFI) since that is where the new path needs to be set. The provided answer provides the basic groundwork to make sure that transition is seamless since the permissions, file/folder structure, ntfs perms, and shares will be properly setup in the new location. – user2320464 Feb 3 '16 at 21:07
  • FYI, IIS manager doesn't provide any way to move the SMTP application paths; the only ways to actually achieve this are tricky, undocumented and unsupported; this is the reason why the question has been posted. – Massimo Feb 3 '16 at 22:08
  • And while your suggestions make sense and would have been welcome along with a proper answer, the fact remains that you have not actually answered the main question. – Massimo Feb 3 '16 at 22:08
  • Thanks for the contribution user2320464 but Massimo is correct, I apologise if I was not 100 percent clear but I do not need to know how to mirror the directory structure but how to redirect IIS to use the different location. I cannot locate anywhere within IIS6 the redirection for the mailroot and each of the subdirectories i.e. the Queue folder. I'm assuming there must be a registry entry or something but I am struggling to find any documentation. – Rld Feb 4 '16 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.