5

How can I configure the IIS SMTP service to store all emails (regardless of domain) in the drop folder?

I'm trying to catch all emails sent to an SMTP server during testing. I don't want to relay the emails on to their final destination, I just want them to sit in the C:\inetpub\mailroot\Drop folder so that I can inspect them later on.

Is this even possible with IIS's SMTP server?

I'm using Server 2008 R2 Standard with just the SMTP feature installed.

2 Answers 2

4

There are probably a number of ways to do this, but I'm thinking that if you configure the SMTP server to use a smart host for delivery and plug in a bogus ip address that will keep it from being able to deliver any emails. I'm not sure if it will cause the SMTP server to move the emails to the badmail folder or not, but at the end of the day it will keep the emails from being delivered and they'll be available to you regardless of the folder they're in.

2
  • This sounds like a simple and obvious option! Palm+Forehead. I'll test it out tomorrow. Sep 24, 2009 at 16:20
  • 1
    This worked perfect for us - IIS just drops the non-routable mail into the Bad folder (c:\inetpub\mailroot\badmail). Great suggestion! Jul 27, 2015 at 13:50
0

I tested this on a 2003 box and it worked. I did not specify a smarthost at all and what it did is keep the e-mails in the Queue folder. Since it can't connect to a smarthost it just holds onto them in the Queue folder. Standalone IIS SMTP doesn't do domain lookups AFAIK and needs a value for the smarthost to be able to send e-mail onward (I don't know if this changed in 2008 however). You may want to adjust your timeout settings if you want to hang onto them for awhile because it may delete them after the message expires.

6
  • By default (on 2008 R2 at least) it bounces the emails if they're not for a specified domain. Sep 24, 2009 at 16:19
  • Just to clarify: The IIS SMTP service is a fully functional SMTP server and does not require a smart host for sending email. It's completely capable of sending email on it's own.
    – joeqwerty
    Sep 24, 2009 at 16:20
  • @joeqwerty - How would IIS SMTP be able to send mail without a smarthost? Please clarify as I am unaware of any other method - I see an LDAP routing tab but have never used it.
    – August
    Sep 24, 2009 at 16:36
  • How could it not send email, it's an SMTP server. Try it out if you have one handy. Configure the delivery tab with no smart host and then send an email.
    – joeqwerty
    Sep 24, 2009 at 17:05
  • @joeqwerty - Huh, looks like IIS SMTP is smarter than I thought...I was testing sending internally and it was failing, but I was able to send externally with no smarthost configured - looks like you would need to configure a bogus smarthost as you suggested to avoid looking up the recipient mail server and sending the mail.
    – August
    Sep 24, 2009 at 17:33

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.