1

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 myinternaldoamin.com 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 externalemailtest@myinternaldomain.com - 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.

Thanks

Andrew

Andrew Bullock
  • 201
  • 1
  • 2
  • 13

3 Answers3

2

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 myinternaldoamin.com as a remote domain and configure the mail to deliver to your "real" mail server.

JR

Edit:

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.

http://support.microsoft.com/kb/324021 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.

JR

John Rennie
  • 7,776
  • 1
  • 23
  • 35
  • One part of the question is, whether it is possible to forward email for all other domains to externalemailtest@myinternaldomain.com. 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
  • 1
    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
0

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.

Evan Anderson
  • 141,881
  • 20
  • 196
  • 331
0

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).