Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting up an internal SMTP server to handle software tests which involve the sending of emails.

I want to configure the server so that any emails sent to get relayed (is that the correct term?) to our real/main SMTP server (another machine on the same network). Emails being sent to any other domain need to be forwarded to - so they dont actually go to real people, I want to trap them on this account just for testing.

Is this possible?

If so, can someone give me a quick tut on how to do it?

Edit: If what im asking isnt possible in the way im asking, then im open to suggestions on how to achieve the same effect.



share|improve this question

Not only possible, but easy :-)

Unfortunately I haven't got a server to hand with just the SMTP service on it (only Exchange and this messes with the SMTP config interface). From memory if you go into the SMTP server config you can add domains and for each domain you add you configure the mail delivery. The domain can be local, in which case the mail is stored on your server, or remote. For remote domains you can configure the mail to route to a different server.

So you just set up a domain as a remote domain and configure the mail to deliver to your "real" mail server.



The Windows SMTP server can't modify mail headers. It can only pass on mails unchanged. However the Windows SMTP server allows you write event sinks. These are bits of VBScript that get executed whenever mails pass through the server, and from this code you can make any changes you want to the e-mail. This is often used to implement a catchall mailbox, as neither the Windows SMTP server nor Exchange 2k/2k3 provide this. I would be wary of writing synchs for production servers as you have to make damn sure there are no bugs in them and you document them thoroughly. However for the use you suggest they should be fine. is a good place to start. This describes writing a catchall script for Exchange, but you should be able to adapt it for your requirements.


share|improve this answer
One part of the question is, whether it is possible to forward email for all other domains to Is that possible using Windows' SMTP alone? – – splattne Jun 12 '09 at 10:50
yeah, its the other part thats most critical. How do i catch emails to all other domains and have them sent to a different address – Andrew Bullock Jun 12 '09 at 11:20
Oops. As splattne has spotted and as Evan Anderson says, the Windows SMTP server can't modify the mails. It can only relay them. However see my edit for a way of doing this. – John Rennie Jun 12 '09 at 12:07

The SMTP Server included with Windows cannot manipulate header fields (RFC822 or envelope) to "route" mail. It can relay and send SMTP and that's about it. If you need a more fully-featured SMTP server implementation you're going to have to look elsewhere.

If you need this to be "no cost", you might look at the Cygwin port of Exim as one possible solution. You could also run a *nix / Linux instance in a VM and use whatever free SMTP server you'd like on that platform.

share|improve this answer

The built-in IIS SMTP support sucks. Better install any of good free email servers like HMail or MailEnable (We use MailEnable and are happy with it).

share|improve this answer
do either of these support what i want to do? HMail doesn't seem to – Andrew Bullock Jun 12 '09 at 15:41
I am not sure about HMail (never used it), but Mailenable can do it. It supports all kind of forwarding. – MikeNYC Jun 13 '09 at 21:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.