For a number of reasons I'm looking at setting up a IIS box as an SMTP relay before the mail server. Like the setup below:
An important point to note is that this SMTP relay must be able to relay in both directions. That is all email that travels between the internet and the mailserver must travel though the gateway.
I am pretty certain that this can be done, but I'm having some difficulties conceptualising how it is done. I can understand how the IIS server could be configured to relay all mail going in one direction, but not both. Talking through it (as I understand it):
Inbound - easy. relay all mail to the mail server by setting the smart host to the mail server for the default domain.
Outbound - easy. Set the mail server to relay to the IIS box (set IIS to allow relay from the mailserver's IP addr) and let the IIS box handle delivery.
Both: As I see it setting one stops the other from working.
A number of articles have pointed to this as a possibility, however none have gone through the process of setting up the box.
The mail server in question could be any one of a number of mail servers, so please, no suggestions that involve running something on the Exchange/Groupwise/Lotus server. This has to be able to run on a standalone box.