Where are the SMTP settings saved in IIS7/Win2008?

8,025

Solution 1

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.

Solution 2

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.

Share:
8,025

Related videos on Youtube

Mee
Author by

Mee

Updated on September 17, 2022

Comments

  • Mee
    Mee over 1 year

    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.

  • Mee
    Mee over 14 years
    Thanks a lot Scott, I'll check this and see how it works.
  • Mee
    Mee over 14 years
    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
    Mee over 14 years
    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
  • Scott Forsyth
    Scott Forsyth over 14 years
    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)
  • Mee
    Mee over 14 years
    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.
  • Scott Forsyth
    Scott Forsyth over 14 years
    Excellent, glad you figured it out. Metabase explorer is another way to manage permissions and is easier many times because of the friendly UI.