Operating System - Linux
1819796 Members
3106 Online
109607 Solutions
New Discussion юеВ

Configure multiple relay hosts in Sendmail

 
SOLVED
Go to solution
raver_1
Frequent Advisor

Configure multiple relay hosts in Sendmail

Hi!

May I know how do I go about configuring multiple mail relay hosts in /etc/sendmail.cf?

Thanks in advance.


Regards,
Jayce
6 REPLIES 6
Ivajlo Yanakiev
Respected Contributor

Re: Configure multiple relay hosts in Sendmail

Redhat do not use /etc/sendmail.cf
for config sendmail.
You must change sendmail.mc.
Every time when you restart your sendmail it will make sendmail.cf from sendmail.mc and all manula change will be lost :)


raver_1
Frequent Advisor

Re: Configure multiple relay hosts in Sendmail

So is it possible to have multiple SMART Relay hosts defined?
How?
Vitaly Karasik_1
Honored Contributor
Solution

Re: Configure multiple relay hosts in Sendmail

1) it's right that the easiest way to configure sendmail it's using sendmail.mc instead sendmail.cf, but RH linux [at least RHEL 2.1 and 3.0] doesn't build sendmail.cf automatically from sendmail.mc during startup.

2) and regarding Raver question itself - AFAIK, we cannot define several relay hosts in sendmail config. But you may create local DNS server and define several IPs for the same hostname.
I mean - you can create several DNS records for your "smart_host" hostname.

Rgds,
Vitaly
kcpant
Trusted Contributor

Re: Configure multiple relay hosts in Sendmail

Hi jayce,

In addition to Vitaly, I want to tell you is sendmail.cf is used in all distributions of Linux or other unix flavours, don't get confused with the first answer.sendmail.cf is a file of sendmail package, and it does not change it's behaviour for different OS. sendmail.mc is the macro definition file, from where you can define features and other inputs for your setup very easily, and then make sendmail.cf through it( m4 sendmail.mc > sendmail.cf , or other way ). and for your problem ( defining several smart hosts), Vitaly is right, you can't define more than one smart hosts, but you can make "virtual" DNS entries for this purpose.
PreSales Specialist
raver_1
Frequent Advisor

Re: Configure multiple relay hosts in Sendmail

Thanks all for reply.

Cheers,
Raver
Kyriakos_1
New Member

Re: Configure multiple relay hosts in Sendmail

Actually the previous answers that this is not possible do not seem to be entirely correct :-)

If you want to use multiple smart hosts then try the following in your mc file:

define(`SMART_HOST',`host1:host2:host3')

or in your sendmail.cf

DShost1:host2:host3

( The syntax is [mailer:]host[:host...] )