Tuesday, March 22, 2011

Windows Server 2008 SMTP Service logging

I was working on installing Windows Server 2008 x64 edition. I discovered the SMTP Service wasn't logging. SMTP was working and emails were going out. My install is 'custom' and installs just the modules we needed. Turns out, there is a small dependency on the ODBC logging module so the SMTP service logging would work. More importantly iislog.dll. Here are the instructions to fix and reproduce the behavior.

To correct it. I'm assuming you have the SMTP Service already installed and it's not logging.

1) Install ODBC Logging module (role service in Server Manager)

2) Stop / Start the SMTP Service

3) Verify your SMTP service is configured for logging. It's not on by default.

4) Try a local telnet test (assuming the telnet client is installed)

5) Look at your log folder.

To Reproduce the logging 'behavior'

1) Install Windows Server 2008 (obvious step)

2) Install the basic web server components. (static content with anonymous user)

3) Install telnet client and SMTP services

4) Enable logging on SMTP instance

5) try a telnet test locally

6) Verify the smtpsvc folder isn't in the location you configured for logging (default is c:\windows\system32\logfiles)

7) Add the ODBC logging module (no iisreset is required) *Or in my tests there wasn't

8) Stop / Start the SMTP service (net stop smtpsvc && net start smtpsvc)

9) Try another telnet test

10) Verify the SMTPSVC folder is present.

Hope this saves you some time, it took me a while to find the right mix.

Thanks a bunch to Bernard Cheah who helped point me in the right direction

------------------------------------------------------------------------------------

While configuring SMTP server, I got the errors while clicking on Current Sessions. That error is “No Such Interface supported.”

Looking at that in detail and some blogs, I found that there are 2 problems:

1) Log is not created in SMTP log folder
2) We could not view current session as we got the error message “No Such Interface supported.”

Both problem is resolved by taking following steps:

1) Go to Server Manager and Install ODBC Logging module (You can search on net how to install Role Services Feature)

2) Stop and Start SMTP Server service. Enable logging in SMTP server.

3) connect SMTP server by telnet

4) Now, see if log is created in the respected log folder. If not, you can try the command to flush the log buffer

netsh http flush logbuffer
5) See if now log is created. It must be there. Else god will help you .

Now for another part, you need to register the following dll.

C:\Windows\System32\inetsrv>regsvr32 smtpsnap.dll
C:\Windows\System32\inetsrv>regsvr32 smtpadm.dll

Stop and Start SMTP Service.

No comments:

Post a Comment