I have a problem getting SMTP to work with an ASP.NET app I have (the error I get is "Cannot get IIS pickup directory"). The app delivers the mail to SMTP using the pickup directory.

I already know what causes the error, it's a permissions problem accessing the SMTP settings (see this link http://www.laptev.com/?p=3). I use a custom windows user for that app which seemingly doesn't have the permissions to access the SMTP settings, when I use the NetworkService account, everything works fine but when I use my custom user, I get the error. Now I'm trying to figure out where the SMTP settings are saved in Windows2008/IIS7 to give the needed permissions to my custom user.


There are a couple solutions. If you explicitly set the pickup folder in code then it doesn't need to be gotten from the metabase and you don't need to worry about the permissions. If you control the code, that's the easiest solution.

However, if you have a lot of users that may want to get the pickup folder automatically, then you'll need to grant the extra permission.

Since it's safe to expose read-only access to the pickup folder path property, the easy solution is to grant the IIS_WPG group access. cscript Metaacl.vbs “IIS://localhost/SMTPsvc” IIS_WPG RE

To answer your question on where it is, SMTP wasn't ported to the new system in IIS7. It still uses the old metabase settings in c:\windows\system32\inetsrv\metabase.xml. You manage it with IIS 6 manager.

  • Thanks a lot Scott, I'll check this and see how it works. – Mee Oct 24 '09 at 3:34
  • What about specifying the pickup directory in web.config? will this work? This is be better than hardcoding the path and still allows for overriding the SMTP settings in the metabase, I'm going to test that and see how it works. – Mee Oct 24 '09 at 3:51
  • Unfortunately it didn't work. I tried granting permissions to the custom user using the Metaacl.vbs script, I also tried specifying the pick directory in web.config but neither worked – Mee Oct 24 '09 at 4:20
  • What errors did you get when trying to specify it in web.config? (good idea btw). I just checked the metabase and the post you referenced has a slight mistake. It should be IIS://localhost/SMTPSvc/1. Try that instead. If it doesn't work then try granting 'Users' access to confirm that it's a permissions issue that you're running into (and remove it again after troubleshooting) – Scott Forsyth - MVP Oct 24 '09 at 8:01
  • Thanks a lot Scott, your answer helped me go in the right direction to find the solution. Actually I also tried ISS://localhost/SMTPSvc/1 but unfortunately that didn't work too. After reading that forum thread I downloaded metabase explorer and used it to change the permissions. – Mee Oct 24 '09 at 11:14

Finally, after spending many hours searching for a solution, I came across this forum thread: http://forums.iis.net/t/1032876.aspx?PageIndex=1

I downloaded and installed the metabase explorer tool (you have to download IIS6 resource kit to get it) then gave read permissions to my custom user (as indicated in one of the posts) on the LS, SMTPSvc and SMTPSvc/1 keys and it worked! For some unknown reason if you only give permissions to the smptSvc key it doesn't work.

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.