The problem

You want to operate a Sendmail server, and for various reasons you cannot or do not want to use Postfix, Exim or Qmail. However, your Sendmail should not deliver the mails itself, but only forward them to a smart host.

This all works, but: Your Sendmail cannot deliver mails without a working name resolution. This is especially annoying because this is actually superfluous when using a smarthost.

If you call up the undelivered mails with mailq -Ac you will see entries with deferred and hostname lookup.

The cause

The exact cause is not (exactly) known. Sendmail tries to resolve or check host or domain names at various points.

A solution

Create a file /etc/mail/service.switch with the following content:

/etc/mail/service.switch:hosts files
aliases files

Now add the following line to your code sendmail.mc:

/etc/mail/sendmail.mc:define(`confSERVICE_SWITCH_FILE',`/etc/mail/service.switch')dnl

Do not forget to rebuild the file sendmail.cf by calling make, and then restart or at least reload Sendmail.

Linux knowledge

Questi articoli sono stati scritti dal fondatore di Checkmk molti anni fa.
Tuttavia, sono ancora validi e quindi li conserviamo sul nostro sito web.
Da allora Mathias ha sviluppato il software di monitoraggio che oggi è Checkmk.

Scopri di più