Using combinations of hostname and IP in sendmail SMART_HOST macro
An interesting sendmail question came up today: does the sendmail SMART_HOST macro support using combinations of hostname and IP addresses for backup destinations? Or do all values need to be IP addresses?
For example, what if I want sendmail to try relaying a message to smtp-server-pool.example.com first and if that fails, only THEN try delivering to 1.1.1.1, and finally 2.2.2.2?
The short answer, is yes, it does support/work (hat tip to the sendmail devs for building in this flexibility). Continuing with the example above, the config looks like this:
define(`SMART_HOST',`relay:[smtp-server-pool.example.com]:[1.1.1.1]:[2.2.2.2]')dnl
Great stuff.












