Where Are SMTP Settings Saved in IIS7/Windows Server 2008?

iisiis-7smtpwindows-server-2008

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.

Best Answer

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.