views:

170

answers:

2

I'm developing a website on an XP virtual machine and have an SMTP virtual server set up in IIS -- it delivers mail just fine. What I would like is to confirm that any emails the site sends are only going to a specific domain.

The XP firewall seems to only involve incoming connections, I can't block outgoing TCP on port 25. And I haven't been able to configure the SMTP server to filter by delivery address.

With this setup, is there any easy way to filter outgoing email by destination address?

A: 

I think the easiest way would be to add a check to your mail sending code on the website (there's got to be some class which is in charge of sending the mails out).

You could include a check which is only active when the code is compiled in debug mode (using compiler directives). Thus, when you are developing and building the site in debug mode, this code checks if the outgoing messages are valid (specific domain) or not. If they are it lets them go, else it doesn't send the mail.

Vaibhav
+1  A: 

Here's one idea:

Under Advanced Delivery options (SMTP Virtual Server Properties > Delivery tab > Advanced). There you can set a "Smart Host" which is the SMTP server that will be used to actually send the mail, so you could possibly have it deliver directly to the specific domain's incoming SMTP server.

Neil C. Obremski
Thank you, that's working for me just perfectly!
James