1833176 Members
2953 Online
110051 Solutions
New Discussion

Sendmail DS macro

 
Michael Burbury
Frequent Advisor

Sendmail DS macro

Hi all,

I have two outbound smart email relays/gateways (Trend Micro Interscan Viruswall).

I have currently setup the Sendmail DS macro to point to one of them for outbound email routing, but the system blew a power supply yesterday and outbound email stopped until I edited sendmail.cf and changed the DS macro to point to the other gateway and restarted sendmail. Is it possible to specify two outbound smart relays (and is it possible to load balance outbound email using this method?)

Appreciate help from Sendmail guru.
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Sendmail DS macro

I don't think you can do that, but here is how I'd kludge around it. I'm turning on notify because if I'm wrong, I want to know how.

If I'm right though....

Assuming you can ping the gataway(we can't) you can create a cron job that occaisionally pings the main gateway. no response, it switches to the alternate sendmail.cf and restarts sendmail daemon.

Probably better is a job that scan's the mail log /var/adm/syslog/mail.log for connect failures and does the same.

Here is the flow

tail /var/adm/syslog/mail.log | grep

then the job does this.

cp /etc/sendmail.alt /etc/sendmail.cf

/sbin/init.d/sendmail stop
/sbin/init.d/sendmail start

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Michael Burbury
Frequent Advisor

Re: Sendmail DS macro

Thanks, 5 points for an interesting workaround. Though we do several thousand emails a day (constantly almost 24x7) so load balancing would be my preference if anyone knows a way to achieve it?
T G Manikandan
Honored Contributor

Re: Sendmail DS macro

Yes you can do that by seperating hostnames by a colon with the DS

DShostA:hostB:hostC

First,it will look for hostA and if hostA does not respond then it will look for hostB and so on.
Like above it can be redundant.

Steven E. Protter
Exalted Contributor

Re: Sendmail DS macro

I learned something new.

It's not really load balancing, but it seems to provide redundancy and it sort of load balances if the cause of the problem is overload on A

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Michael Burbury
Frequent Advisor

Re: Sendmail DS macro

TG - 10 points - excellent!!