My machine (CentOS, sendmail-8.14.7-5.el7) accepts emails from machines and forwards all of them to my smarthost my-smarthost.mydomain.com, which in turn has several dynamic MX-records). Local mail stays local (using the alias-file).

define(`SMART_HOST', `smtp:my-smarthost.mydomain.com')dnl

Today I noticed a problem:

# mailq
        /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
02AG1YBC023172     1239 Tue Mar 10 17:01 <sender@some-domain.com>
      8BITMIME   (host map: lookup (non-domain.com): deferred)

# sendmail -v -q
Running /var/spool/mqueue/02AG1YBC023172 (sequence 1 of 1)
non-domain.com: Name server timeout
<john.doe@non-domain.com>... Transient parse error -- message queued for future delivery

Why does sendmail try to dns lookup the addresses inside the mails? I thought it just forwards everything non-local to the smarthost!

I tried to use the trick to disable DNS-lookup with


and so on, but there is a problem with that: This also disables the MX-search for the smarthost! So the dynamic MX-records for my smarthost are no longer found/used!

Any ideas how to stop sendmail from doing anything except relaying to the smarthost?

  • How do you define non-local in your rules? If you are using an IP (or an IP, fqdn mixture) then `sendmail might need to resolve to evaluate the rule. Mar 10 '20 at 20:49

Consider using FEATURE(nocanonify)

nocanonify Don't pass addresses to $[ ... $] for canonification by default, i.e., host/domain names are considered canonical, except for unqualified names, which must not be used in this mode (violation of the standard). […]

It should stop sendmail from asking DNS about domains in header addresses.

  • 1
    Would you consider adding some words of explanation on why and how this solves the problem? Link-only-answers are often considered not so helpful and tend to get deleted ...
    – AdminBee
    Mar 11 '20 at 7:38
  • No, I didn't consider it because I was not aware that this option prevents the usage of DNS lookups for checking/canonification. (Yes I didn't understand that "Don't pass addresses to $[ ... $] for canonification by default" means DNS lookups.) But you are correct: If I set this feature sendmail works as expected! Mar 11 '20 at 9:45
  • This seems to have solved an issue I was having with a server that uses a smart relay host, Thanks! Mar 15 at 12:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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