Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

CentOS | Sendmail

I have the following line in my file:


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

Can I specify a third entry here? For example:


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

share|improve this question
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,
                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


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.