I had a query on IIS 7 SMTP and NDR generation that I was hoping
someone could help me with.
We use IIS SMTP as a relay server for application servers to send
mail:
Applications servers > IIS SMTP server > Mail Relay (Postfix) >
Internet/Internal Exchange servers
The applications servers are all configured to send SMTP mail to
iisrelay.domain.com
The server running IIS has a smart host of postfix.domain.com
configured
The Postfix server will either send the mail to the Internet for
delivery or to our internal Exchange servers for delivery.
The IIS server also has a configuration to send a copy of all NDR's to
ad...@domain.com
My questions were:
i) Let's say an application server (ap...@domain.com) tries to send a
mail to us...@domain.com but the recipient address doesn't exist.
Where would the NDR be generated from? I assume it's the Postfix relay
and, if so, would I be correct in saying that a copy of the NDR won't
be sent to ad...@domain.com since the IIS server passes the message
onto the Postfix relay without issue, therefore won't know about any
failure 'upstream'?
ii) Would I be correct in saying that a copy of the NDR will only be
sent to ad...@domain.com if there is a problem with the message being
delivered to the Postfix relay, i.e the hop between IIS and Postfix?
Once the Postfix relay has accepted the message for relaying, the IIS
relay is no longer involved even if the message doesn't reach the
eventual destination?
iii) Are there any tools to monitor SMTP usage on the IIS server (e.g.
if an application server tries to send thousands of messages and we
want to be alerted on this)?
iv) I mentioned that the IIS server has a smarthost configured of
"postfix.domain.com". We would actually like to eventually have more
than one Postfix relay, so is it possible to have postfix.domain.com
as an MX record that points to:
postfix1.domain.com > 192.168.1.0 *and* 192.168.2.0 Priority 10
postfix2.domain.com > 192.168.3.0 *and* 192.168.4.0 Prority 20
In which case, let's say 192.168.1.0 was too busy to accept any
incoming SMTP connections. Would IIS immediately try 192.168.2.0 or
would it try one of the IP's in the lower priority record?
As always, really appreciate the guidance :)
Thanks.
That is correct and easily tested.
> ii) Would I be correct in saying that a copy of the NDR will only be
> sent to ad...@domain.com if there is a problem with the message being
> delivered to the Postfix relay, i.e the hop between IIS and Postfix?
> Once the Postfix relay has accepted the message for relaying, the IIS
> relay is no longer involved even if the message doesn't reach the
> eventual destination?
That is correct. There is no reason for a server to consider a message
undeliverable if it was delivered.
What would be the logic otherwise?
> iii) Are there any tools to monitor SMTP usage on the IIS server (e.g.
> if an application server tries to send thousands of messages and we
> want to be alerted on this)?
Sure, plenty of performance counters. No reason to rehash 'em here.
Though for pure point-in-time directory size (queued message count),
you don't need deep counters, just regular filesystem monitoring.
> iv) I mentioned that the IIS server has a smarthost configured of
> "postfix.domain.com". We would actually like to eventually have more
> than one Postfix relay, so is it possible to have postfix.domain.com
> as an MX record that points to:
>
> postfix1.domain.com > 192.168.1.0 *and* 192.168.2.0 Priority 10
> postfix2.domain.com > 192.168.3.0 *and* 192.168.4.0 Prority 20
Well, no.
Smarthosts don't use the MX delivery algorithm. They are "smarter"
than direct delivery. Those MX records will never be retrieved.
The way to get the prioritization you describe is to set up a dummy
DNS server on the mailserver with a fake root (.) that can then
publish wildcard MX records. Then take out the smarthost entry and let
DNS take over as usual. The mailserver will then take advantage of
varying priorities for outbound mailrouting.
If you are uncomfortable setting this up, I would recommend
load-balancing your outbound mail using a fault-tolerant
device/software in front of or on the Postfix boxes, or having a
monitoring solution which can dynamically add/remove hosts from DNS if
they are down or busy -- use a low TTL and this affords you cheap
failover.
-- Sandy
------------------------------------
Sanford Whiteman, Chief Technologist
Broadleaf Systems, a division of
Cypress Integrated Systems, Inc.
------------------------------------
> iii) Are there any tools to monitor SMTP usage on the IIS server (e.g.
> if an application server tries to send thousands of messages and we
> want to be alerted on this)?
>Sure, plenty of performance counters. No reason to rehash 'em here.
>Though for pure point-in-time directory size (queued message count),
>you don't need deep counters, just regular filesystem monitoring.
Do you mean Windows 2008 Perfmon counters?
> iv) I mentioned that the IIS server has a smarthost configured of
> "postfix.domain.com". We would actually like to eventually have more
> than one Postfix relay, so is it possible to have postfix.domain.com
> as an MX record that points to:
> postfix1.domain.com > 192.168.1.0 *and* 192.168.2.0 Priority 10
> postfix2.domain.com > 192.168.3.0 *and* 192.168.4.0 Prority 20
>Well, no.
>Smarthosts don't use the MX delivery algorithm. They are "smarter"
>than direct delivery. Those MX records will never be retrieved.
Ok, so let's say that I did use postfix1.domain.com as my Smart Host.
This resolves to 192.168.1.0 and 192.168.2.0.
Would IIS resolve to either of those IP's of just one? And if the
first was busy, would it immediately retry the second, or wait for the
retry period and then try one of the IP's again?
Thanks again for your help.
Yes, built-in Windows counters accessible via Perfmon API, WMI, SNMP,
etc.
> Ok, so let's say that I did use postfix1.domain.com as my Smart Host.
> This resolves to 192.168.1.0 and 192.168.2.0.
>
> Would IIS resolve to either of those IP's of just one? And if the
> first was busy, would it immediately retry the second, or wait for the
> retry period and then try one of the IP's again?
Your DNS server will shuffle the records, so IIS will get a different
one "first," on average, as the TTL expires and time goes on. To my
recollection, it will not retry the second and subsequent A records
retrieved from a single lookup.