Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

CentOS | Sendmail

I have the following line in my sendmail.mc file:

define(`SMART_HOST',`relay:[1.1.1.1]:[2.2.2.2]')

My understanding is that sendmail will always smarthost to 1.1.1.1 and then fail-over to using 2.2.2.2 if necessary.

Can I specify a third entry here? For example:

define(`SMART_HOST',`relay:[1.1.1.1]:[2.2.2.2]:[3.3.3.3]')

What are the limits on how many entries I can specify here?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If you look at the $#relay mailer definition, you will see for example that it is defined as:

Mrelay,         P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
                T=DNS/RFC822/SMTP,
                A=TCP $h

So your question effectively becomes: Can $h be a colon separated list, and if yes, for how many hosts? To which the bat book replies in page 739:

Beginning withV8 sendmail, $h (possibly as returned by the parse rule set 0) can be a colon-separated list of hosts. The sendmail program attempts to connect to each in turn, left to right:

A=TCP hostA:hostB:hostC

Here, it tries to connect to hostA first. If that fails, it next tries hostB, and so on. As usual, trying a host means trying its MX records first, or its A or AAAA record if there are no MX records.

For the actual limit one would have to look at the sendmail sources to verify if any exists.

There is second argument implied in A=TCP $h which is omitted and this is the port number (assumed by default to be 25). You can have a host list and a single port, but I am not sure whether (or how) you can have a host list with a different listening port for incoming connections for each host on the list. For such an elaborate and tricky setup I would write another delivery agent that could make use of this.

share|improve this answer
    
Thanks. So it sounds like at there very least there isn't a hard-set limit of ONLY two, right? Especially since the bat book would reference "hostC". –  Mike B Jun 1 '12 at 16:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.