multiple smart hosts

multiple smart hosts

am 01.08.2007 17:39:54 von dholmes007

OK - so I have an application running on a Linux box. That application
calls sendmail and generates an email message. I want ALL email
messages to go to my email gateway for routing to their ultimate
destination. A Smart Host entry in the sendmail.cf should do this,
right?

Here's the thing - suppose that Smart Host goes down for whatever
reason. As it happens, I have 4 email gateways handling outgoing SMTP.
I want my application to be able to generate mail, and if one of those
4 gateways is down, I want it to automatically use a second one, and
if that one is down, automatically use the 3rd, and so on.

Can sendmail do that? How do I configure that?

Thanks.

Re: multiple smart hosts

am 01.08.2007 17:49:58 von gtaylor

On 08/01/07 10:39, dholmes007@gmail.com wrote:
> Here's the thing - suppose that Smart Host goes down for whatever
> reason. As it happens, I have 4 email gateways handling outgoing
> SMTP. I want my application to be able to generate mail, and if one
> of those 4 gateways is down, I want it to automatically use a second
> one, and if that one is down, automatically use the 3rd, and so on.
>
> Can sendmail do that? How do I configure that?

I do not think that Sendmail can do this its self. However in my
opinion, short of having a list of servers to try, this is really out
side of the scope of what Sendmail should do. In my opinion, your
question would be better answered by a (redundant) load balancer in
front of your email gateways.

Granted, it would probably be nice if Sendmail could do something akin
to MX lookups to build a list of Smart Hosts to try in sequence and / or
randomly. However I think this is primarily still out side the scope
of Sendmail.



Grant. . . .

Re: multiple smart hosts

am 01.08.2007 17:54:41 von Andrzej Adam Filip

dholmes007@gmail.com writes:

> OK - so I have an application running on a Linux box. That application
> calls sendmail and generates an email message. I want ALL email
> messages to go to my email gateway for routing to their ultimate
> destination. A Smart Host entry in the sendmail.cf should do this,
> right?
>
> Here's the thing - suppose that Smart Host goes down for whatever
> reason. As it happens, I have 4 email gateways handling outgoing SMTP.
> I want my application to be able to generate mail, and if one of those
> 4 gateways is down, I want it to automatically use a second one, and
> if that one is down, automatically use the 3rd, and so on.
>
> Can sendmail do that? How do I configure that?

define(`SMART_HOST',`esmtp:smart_host1:smart_host2:smart_hos t3')dnl
It is `mailer specific'. It will work for all 5 smtp mailers.
[esmtp,smatp,smtp8,dsmtp,relay]

Using `internal MX record' as `smart host' may be a better choice giving
a (simple) load balancing option.

--
[pl>en: Andrew] Andrzej Adam Filip : anfi@priv.onet.pl : anfi@xl.wp.pl
pediddel:
A car with only one working headlight.
-- "Sniglets", Rich Hall & Friends

Re: multiple smart hosts

am 01.08.2007 18:03:35 von dholmes007

On Aug 1, 11:49 am, Grant Taylor wrote:
>
> I do not think that Sendmail can do this its self. However in my
> opinion, short of having a list of servers to try, this is really out
> side of the scope of what Sendmail should do.

Thanks Grant for the reply. You mentioned "having a list of servers to
try" - Is this a viable option? How would it be configured? It is
unlikely that I can add another device to the environment unless it is
truly the only way to ensure reliability. The gateways seldom fail,
but I need to assure the application owners that they would not have
to manually re-configure sendmail on thier Linux box if/when we ever
have a gateway outage.

Re: multiple smart hosts

am 01.08.2007 18:12:58 von John L

wrote in message news:1185982794.064076.226610@k79g2000hse.googlegroups.com.. .
> OK - so I have an application running on a Linux box. That application
> calls sendmail and generates an email message. I want ALL email
> messages to go to my email gateway for routing to their ultimate
> destination. A Smart Host entry in the sendmail.cf should do this,
> right?
>
> Here's the thing - suppose that Smart Host goes down for whatever
> reason. As it happens, I have 4 email gateways handling outgoing SMTP.
> I want my application to be able to generate mail, and if one of those
> 4 gateways is down, I want it to automatically use a second one, and
> if that one is down, automatically use the 3rd, and so on.
>
> Can sendmail do that? How do I configure that?
>
> Thanks.
>

You can just specify multiple smarthosts, separated by
colons, eg [a.b.c.d]:[e.f.g.h] and it should automatically
failover to using e.f.g.h when a.b.c.d is down.

--
John.

Re: multiple smart hosts

am 01.08.2007 18:43:35 von gtaylor

On 08/01/07 11:03, dholmes007@gmail.com wrote:
> You mentioned "having a list of servers to try" - Is this a viable
> option? How would it be configured?

I was mentioning that as a desired feature request type thing, not that
this feature actually presently exists.

One thing that you might be able to do would be to set up a DNS service
name with a short time to live that resolves to your multiple gateways.
Then if there is an outage, update DNS and tell your clients and / or
restart their clients depending on it. I know that this is not optimal,
but it is one way to provide an abstraction layer that can fairly easily
be utilized with out requiring clients to reconfigure their client(s).



Grant. . . .

Re: multiple smart hosts

am 02.08.2007 13:37:07 von zoot

On 1 ao=FBt, 18:43, Grant Taylor wrote:
> On 08/01/07 11:03, dholmes...@gmail.com wrote:
>
> > You mentioned "having a list of servers to try" - Is this a viable
> > option? How would it be configured?
>
> I was mentioning that as a desired feature request type thing, not that
> this feature actually presently exists.
>
> One thing that you might be able to do would be to set up a DNS service
> name with a short time to live that resolves to your multiple gateways.
> Then if there is an outage, update DNS and tell your clients and / or
> restart their clients depending on it. I know that this is not optimal,
> but it is one way to provide an abstraction layer that can fairly easily
> be utilized with out requiring clients to reconfigure their client(s).
>
> Grant. . . .

You can, if you have any control on your DNS, have entries like:
in your domain: example.com
MX 10 blbla1.com
MX 10 blabla2,com
MX 10 truc.machin.com...etc
in your sendmail.cf you need:
DSexample.com

you can also have (still in DNS )
mailhost.here.com IN A 123.456.78.12 234.456.23.44. etc..
and in your sendmail.cf you need:

DSmailhost.here.com

as mentioned before you can also have entry like
DSmailhost1:mailhost2,..
But verfy the Timeout series for having that to work.

O Timeout.connect=3D5s

Regards
Zoot

Re: multiple smart hosts

am 02.08.2007 16:59:02 von gtaylor

On 08/02/07 06:37, zoot wrote:
> You can, if you have any control on your DNS, have entries like:
....
> in your sendmail.cf you need:
> DSexample.com

I think that DNS will provide a nice layer of abstraction that could be
used to your advantage as far as allowing you to add or remove servers
from the list with out having to have customers update their configs.
Also, you could use DNS with other MTAs.

> as mentioned before you can also have entry like
> DSmailhost1:mailhost2,..
> But verfy the Timeout series for having that to work.
>
> O Timeout.connect=5s

However if things are going to be extremely static, say for multiple
years, the simple config in the cf / mc file would be easier to
implement one time and walk away from.

In short it the abstraction layer worth the extra effort or not. In my
opinion, yes it is.



Grant. . . .

Re: multiple smart hosts

am 03.08.2007 09:17:36 von zoot

On 2 ao=FBt, 16:59, Grant Taylor wrote:
> On 08/02/07 06:37, zoot wrote:
>
> > You can, if you have any control on your DNS, have entries like:
> ...
> > in your sendmail.cf you need:
> > DSexample.com
>
> I think that DNS will provide a nice layer of abstraction that could be
> used to your advantage as far as allowing you to add or remove servers
> from the list with out having to have customers update their configs.
> Also, you could use DNS with other MTAs.
>
> > as mentioned before you can also have entry like
> > DSmailhost1:mailhost2,..
> > But verfy the Timeout series for having that to work.
>
> > O Timeout.connect=3D5s
>
> However if things are going to be extremely static, say for multiple
> years, the simple config in the cf / mc file would be easier to
> implement one time and walk away from.
>
> In short it the abstraction layer worth the extra effort or not. In my
> opinion, yes it is.
>
> Grant. . . .

Of cause it would be much better, and safer to make all the changes in
the xx.mc file. I mentioned the sendmail/submit.cf files because it's
faster to modify and can be immediatly tested, but please do youself a
favor and apply the changes also in your .mc file so that you can
easely apply the same configuration into futre sendmail releases.

Zoot

Re: multiple smart hosts

am 10.08.2007 05:22:05 von srevilak

> Here's the thing - suppose that Smart Host goes down for whatever
> reason. As it happens, I have 4 email gateways handling outgoing
> SMTP. I want my application to be able to generate mail, and if
> one of those 4 gateways is down, I want it to automatically use a
> second one, and if that one is down, automatically use the 3rd,
> and so on.

Aside from colon-separated smart-hosts, DNS round robin (DNS-RR) is
also something to consider. Although it accomplishes a slightly
different goal that what you stated.

Suppose your four servers had ip addresses numbered 10.1.1.11 -
10.1.1.14. You'd set up A records

mx.gw.example.com. IN A 10.1.1.11
mx.gw.example.com. IN A 10.1.1.12
mx.gw.example.com. IN A 10.1.1.13
mx.gw.example.com. IN A 10.1.1.14

and use mx.gw.example.com the smart host. Your resolver will
round-robin (equal weighting) through the A records with successive
dns lookups.

Depending on the number of machines feeding the gateways, this can
configuration maintenance easier. Suppose you add another gateway,
and you have a hundred application servers that send mail; all you
need to do is add an A record (as opposed to changing each application
server).

The one thing DNS RR doesn't give is automatic failover. But in
practice, I've found it pretty easy to bring up the failed gateways ip
address on one of the surviving gateways. If you're monitoring your
mail servers (and you should be :), then you should find out about
gateway failures in reasonably short order.

As another poster mentioned, hardware load balancers (LBs) will give
you both load-balancing and instant failover. The only disadvantage
to hardware LBs is that they make it more difficult to debug delivery
issues. With DNS-RR the application-server sendmail will log the ip
of the smarthost is used (in the relay= attribute), so it's easy to
trace messages from one machine to another. With a hardware LB,
all of your appliation servers will log the LB's IP address -- you
have to figure out the delivery route from there.